This is a preliminary step for moving the comparison and
application logic of each section into the dialog.
Essentially, the dialog will pass the duplicate event to each
section, and these sections will modify the event. If the user
presses "Save", the dialog will compare the edited event to
the original event, and apply if they are different.
This also adds the `get_event()` method which will be used
in the future.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
This adds:
- `gcal_event_alarms_equal()`
- `gcal_event_schedule_equal()`
- `gcal_event_strings_equal()`
We aren't going to make use of it yet, but eventually these functions
will be used for the event editor dialog, as well as writing tests for.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/783>
As described in the previous commit, this approach is more
predictable because the focus is decided in the same place.
The focus grabbing behavior is set after notifying
the `GcalEventEditorDialog:event` property as otherwise it would
not select the entire text in some occasions.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/782>
This will allow for a cleaner and more predictable focus behavior,
as this will give the capability to the dialog to grab focus
on either the "Done" button or summary section depending on the
writability, as opposed to the current approach, where the
summary section assumes that it is already writable and grabs focus,
which then the dialog sets focus on the "Done" button.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/782>
The end goal is to make GcalEventEditorSection require inheriting
AdwPreferencesGroup. Given that most widgets utilizing
GcalEventEditorSection inherit another widget, we first want to
change and adapt the inheritance, and then bump the requirement
of the interface.
These changes will be made incrementally, starting
with GcalNotesSection.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
Using GDateTime utilities is costly and shows up high in profiling.
That's because GDateTime has to run timezone offset checks for every
comparison. We can amortize this cost by converting these datetimes
to unix timestamps upfront, and using them for comparisons.
A complication is date-only ranges, for which unix timestamps wouldn't
work. For this, add a new kind of timestamp that only accounts for the
dates.
Add a new test case for date-only comparison.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/770>
Currently, clicking on a calendar in the sidebar's listbox traps
the keyboard focus. As a result, pressing PageUp or PageDown
scrolls the listbox instead of switching the date.
Similar to commit fbc18174 for the week view, this adds a
capture-phase ShortcutController to the calendar listbox. This
ensures that PgUp and PgDown consistently switch month or week
regardless of whether a calendar item is focused.
Fixes#1593
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/771>
The current notes text view has had a 2px offset for
an unknown amount of time, due to us magic-numbering
margins and/or padding. This approach works a little
bit differently, in that it uses the `.editable-area`
style class and sets the overlay's CSS name to "box"
to use a predictable size of margins from AdwEntryRow.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/738>
But mark them as not child visible. This should make keyboard
navigation work again, as the focused rows don't change actual
visible state, and thus are keyboard navigatable and don't lose
focus.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/769>
The tick callback can be fired *after* the GtkWidget.map() vfunc is
called, in which case the recalculate_layout_blocks() will run with
an already recalculated layout, which is invalid.
Only call recalculate_layout_blocks() when the blocks are invalidated.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/768>