This fixes an issue where pressing Shift + Up/Down while focused on the
overflow button will result in a bail out when asserting the focused
widget has a month cell ancestor:
```
GcalMonthView:ERROR:../src/gui/views/gcal-month-view.c:1002:on_key_controller_key_pressed_cb: assertion failed: (GCAL_IS_MONTH_CELL (month_cell))
Bail out! GcalMonthView:ERROR:../src/gui/views/gcal-month-view.c:1002:on_key_controller_key_pressed_cb: assertion failed: (GCAL_IS_MONTH_CELL (month_cell))
```
When navigating between month cells with a keyboard, focus is set
on respective month cells, so checking whether the ancestor
is a month cell or not is not only unnecessary, it also causes
bugs like the assertion above.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/720>
While "7" may be obvious in the context of calendaring that
it represents the number of week days, it often gives me the
impression of it being a magic number when I'm hyperfocused on certain
parts of the codebase for several consecutive hours. Turning the
number into a macro helps me scan functions much more easily.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/674>
Without this patch, focus immediately goes to the "Previous Month"
button at startup, for some unknown reason.
So, as a workaround, skip focus if the root cannot retrieve the
current focused widget.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/564>
This will be needed for setting focus to the last focused widget
after closing the popover.
Alternatively, we could have used the "unmap" signal, but this causes
a significant delay before setting focus to the last focused widget,
as it needs to complete the animation before it emits the
"unmap" signal.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/598>
Ideally, we should be comparing if the Y coordinate of both the
candidate and focused widgets are identical, but given font
sizing issues with special characters such as emojis
(see https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1519),
it is safer to check if these widgets intersect vertically, as
otherwise a single pixel offset may cause keyboard focus to
completely skip event widgets.
The SEPARATOR_OFFSET constant is for the box shadow property
defined in month cells' CSS. Since the box-shadow property does
not contribute to layout, so these offsets need to be set manually.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/676>
Currently, month cells are using `round()` to allocate the width,
whereas event widgets are using implicit double → int conversion,
which causes event widgets to be offset by a pixel, and thus
touches month cells' borders.
This new approach guarantees the exact width of the event widgets
by invoking `round()`.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/676>
The current animation duration paired with the ease-out-quad function
eases out imperceptibly fast (almost instantaneously), which makes the
overall animation feel laggy.
This patch addresses the aforementioned issue by increasing the
duration to 500ms. This then makes the ease-out-quad function ease
out relatively slowly, which is addressed by changing the function
to ease-out-quart - a function that eases out much quicker.
As a result, the animation should feel much more fluid and natural,
without giving the impression that it's 3 times slower.
Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1125
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/670>
Add a pill style to the label of the first day of the month to make it easy to identify. Adjust the border radius of the existing pill style for the current date to be the same. Apply the font-weight using the new style class.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/647>