GcalAgendaViewItem is an auxiliary object that will be used instead of
the raw events by GcalAgendaViewDay in a later commit to construct the
event widgets inside the main ListView of the agenda view as opposed to
a creating them inside of a `GtkListBox` inside each row of the
ListView.
Holding a reference to the event widget will be necessary in later
commits, so when a ListView row is activated, we can query its model of
GcalAgendaViewItem's with the given activated position, and pass the
correct item's event widget to `gcal_view_event_activated ()`
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
The new menu allows opening either the new-local-calendar or the
new-online-calendar page. As of this commit both pages still show
the same content, this will be fixed in the following commits.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
This page will be replaced by the two pages created in the previous
commits, new-local-calendar and new-online-calendar.
To keep the project compiling the button to add a new calendar now
temporarily points at new-local-calendar. The button will be replaced
by a menu exposing both new pages in one of the following commits.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
If the user has 12h time and sets a properly formatted but invalid time,
Calendar would crash because `date_time` would be `NULL`. This would
specifically happen if the time was set over 23:59 AM or 11:59 PM (ex:
19:00 PM).
By breaking if `date_time` is `NULL`, the crash can be avoided.
Closes#1602
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/848>
Using GtkToggleButton in this case is not only overkill for our
intended use case, it is also a hinderance, as the states and focus
of the widget are handled by the widget itself, which can lead to
unpredictable and undesired behavior.
Using AdwBin solves this problem by allowing us to set the styles
and states from the parent, provided that the CSS name is changed
to "button". Switching to AdwBin also allows us to not override the
`focus()`, `grab_focus()`, and `get_platform_state()` virtual methods.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
This is a prerequisite for removing the strong dependence on the
child GtkToggleButton widget, removing the platform state override,
and adding binding actions in later commits.
Inheriting AdwBin was attempted but it didn't work, as AdwBin
presumably messes with focusability and activation, making
it insufficient for this use case.
`hexpand=true` needs to be explicitly set.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
We no longer use this property. Removing it will then allow us to
directly set the label without having to use GtkStack, but this
will be done in a later commit.
This also sets all transitions to "none".
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
When clicking the previous/next buttons, the view might not be aligned
to the start of the month, which can cause confusion.
Clamping the date to the first of the month removes this confusion by
being consistent. This also matches the behavior of the previous/next
buttons in the main toolbar.
Closes#1606
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/821>
Instead of applying the "dimmed" CSS class - which comes from Adwaita
and applies an overall opacity change - add a new custom "past" CSS
class and change the opacity of specific elements.
This avoids opacity in the group, which in turn allows GTK to avoid
rendering these event widgets in offscreens, which should be faster.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/828>
This is a utility widget akin to GtkGizmo[1] and AdwGizmo[2].
It is designed for use in complex widgets which require additional
features such as snapshotting, measuring/allocating, and
focusing capabilities.
We want to implement an entry row widget that allows multi-line content.
The first implementation had two widgets: GcalNotesRow for the widget
itself, and GcalNotesTitle to contain and animate the title by overriding
the measure() and size_allocate() class methods. The GcalNotesTitle
widget ended up becoming a basic widget that could easily be handled
by GcalGizmo. The new implementation simply uses GcalGizmo.[3]
Another potential user of GcalGizmo is GcalDateChooser, where the
date grid contains complicated logic for handling focus to a child widget.
Since GcalGizmo is designed to give full reign over focusability, we can
also use it to simplify focus. The layout manager can quickly be swapped to
GtkBinLayout since we don't want to handle custom measure/allocation logic.[4]
[1]: <https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkgizmo.c>
[2]: <https://gitlab.gnome.org/GNOME/libadwaita/-/blob/main/src/adw-gizmo.c>
[3]: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/737>
[4]: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/760>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/790>
Ctrl+scrolling with a mouse wheel zoomed in the opposite direction
than expected: scrolling up zoomed out and scrolling down zoomed in,
which is inconsistent with other GNOME apps such as Loupe and
Nautilus.
Negate the scroll delta in both smooth (touchpad) and discrete
(mouse wheel) scrolling cases, so scrolling up now zooms in.
Fixes#1633
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/815>
Before, two finger scrolls on mint cinnamon (X11 scroll instead of
wayland) caused month view to crash. g_clear_obj... orphan would an
animation allowing two animations to exist at once, causing conflict
when the orphan continued in the background. The two animations would be
generated due to X11's legacy support of both discrete notch scrolling
and the two finger smooth scrolling.
I replaced g_clear... with cancel_row_offset_animation in
snap_to_top_row which ensures that the orphaned animation is dead prior
to reassigning variables.
Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1616
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/801>
When an event widget is focused, there is no way to skip the entire
view with key combinations.
This patch addresses this by allowing the user to skip the entire
view when pressing Ctrl+Shift+Tab.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/817>