For now this is redundant, as update_widgets() only sets the
visibility of the time selectors, while the call to
adw_toggle_group_set_active_name() effectively does the same.
But that redundancy will go away in the next step.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/550>
You may think, yet more indirection! But behold:
1. We take events from the widgets ("schedule type (all-day) changed") and turn
them into actions (gcal_schedule_values_set_all_day()).
2. Those actions (e.g. that function) decide how to change the GcalScheduleValues.
3. We compute the desired state of the wigets, based on the new
values.
4. We set the state of the widgets based on that.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/550>
With this, there's no direct mutation of the self->event anywhere; the
_apply() function just uses self->event as a target for mutation
because that's what the surrounding architecture expects.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/550>
The current behavior of the widget makes it so keyboard focus
outlines the toggle button rather than the entire widget. In some
cases, the outline touches the edges of the label, which makes it
look cramped.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/616>
Read-only events show a "Done" button instead of the "Save" button.
The "Done" button does the same thing as "Cancel",
so the "Cancel" button is then redundant.
Likewise, it is impossible to delete events from read-only calendars,
as stated by the banner message in that dialog. In that case,
there's no reason to show a big "Delete" button that you can't click on.
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1168
Creates a chooser managing a GDateTime. The chooser allows the user
to change the date, the time and the timezone independently.
This replaces the precedent GcalTimeChooserRow widget, because it is
easier to manage the different interactions with the user in a single
widget.
Co-authored-by: Georges Basile Stavracas Neto
<georges.stavracas@gmail.com>
Create a new GcalTimeChooserRow widget from AdwEntryRow that parses the
entry into a time, or lets the user pick a time from a popover.
[feaneron] Improved code style, reworked regex management.
Currently we only show writable calendars in the calendar row, but
for read-only events, the read-only calendar must be selected. But
that's impossible because it's not in the model.
Change the model to a flattened list as follows:
+ FlattenListModel -----------+
| |
| + writable calendars -----+ |
| | | |
| | - Calendar 1 | |
| | - Calendar 2 | |
| | - Calendar 3 | |
| | [...] | |
| | | |
| +-------------------------+ |
| + read-only calendars ----+ |
| | | |
| | - Calendar 1 | |
| | [...] | |
| | | |
| +-------------------------+ |
+-----------------------------+
The read-only calendars list only ever has 1 item: the calendar
of the current event, and only if the event is in a read-only
calendar.
Using a tooltip to inform when the calendar is read-only won't
work in touch devices.
This change also improves a11y, as Orca now reads this message,
something that wasn't happening before.
Use the widget to display calendars and distinguish whether
they are visible or not. Currently, it does not distinguish
read-only calendars, but once !494 is merged, it should not
be a problem.