It's possible to change the density of the week view, but only through
pinch-zooming or Ctrl+scroll wheel. This means it can't be done with
only the keyboard, and since neither of these methods are documented,
it's not discoverable either.
This adds shortcuts for zooming the view in and out, and documents them
in the shortcuts dialog to make them discoverable.
Helps #1556
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/859>
We discussed this on Matrix multiple times and came to the conclusion
that crashing the application is preferred on Nightly and during
development. We often miss a critical log message during development
because it gets swamped by all the other logs. Now we can no longer
ignore them.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/857>
`gtk_list_view_scroll_to()` is documented to require that `pos` is
smaller than the number of items in the model. We were not checking
if the model was empty before calling this function, which could
lead to criticals.
Check if the listview model has any items before scrolling it.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/860>
Currently, `gcal_date_time_get_start_of_week()` seems to be
the only user of this macro function. In the next commit, the
month view will use it to traverse weeks while maintaining
the weekday.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/839>
At the moment `gcal_date_chooser_set_date()` is automatically setting
the day to 1, which is undesirable behavior for a method that is
designed to "just" set the date. By connecting to
`GcalMultiChoice::explicitly-changed`, we can simply have the day
set to 1 to accompanying callbacks.
Currently, `multi_choice_changed()` is invoked 50 times at startup.
By using `GcalMultiChoice::explicitly-changed`, `multi_choice_changed()`
is only invoked 10 times. This is still more than ideal, but it's
a significant drop.
Fixes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1639
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/837>
We currently rely on connecting the `notify::value` signal,
which is emitted every time the value is changed explicitly or
implicitly. This can be problematic when, for example, the user
scrolls in the month view, which changes the value of each
GcalDateChooser widget, and each minor difference will re-emit
the signal until it's over. The `GcalMultiChoice::user-changed`
signal will only emit when the user presses the
previous/next buttons.
The next commit will port GcalDateChooser
to `GcalMultiChoice::user-changed`.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/837>
Expanded the introduction and possible areas of contribution. Also
improved structure and added more links to communication channels.
Removed the description of how patches can be submitted, in favour
of a more prominent link to welcome.gnome.org, which provides this
information in much more depth.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/855>
Change the 'get_first_weekday' function to number the weekdays
Monday(1)-Sunday(7) like ISO does. Change the function name to reflect
that. Add tests for different locales, although the tests depend on
system-installed locales.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
Use the gcal-utils to find the actual day in case the desktop setting
for start of week is set to 'default'. After this commit, all usages of
that function have to be changed to use the GcalContext instead.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
Start the enum from Monday-Sunday (1-7). Adapt code that references the
`is_workday()` utility method, which in turn uses the GcalWeekDay enum
to combine pairs of days by bitwise or-ing.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
Since we refactored all events widgets and date headers to be
constructed by GtkListView directly, we are able to use
`gtk_list_view_scroll_to` to jump to the top of the list when opening
the agenda view, and changing date, instead of needing a complicated
timer and GSource callback
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
Similar to the previous commit, we now create the date header label
using the model provided directly from `ListView:header-factory`, by
querying the date of the day the item is in the section of.
This requires copying the auxiliary method `new_date_header_string ()`
from `gcal-agenda-view-day-item.c` to `gcal-agenda-view.c` for
generating the appropriate using facing string for the header
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
GcalEventWidget was adjusted to handle NULL events so it could
more easily be used in GtkListView & family, however, what was
left out of thie adjustment were the functions related to the
orientation of the event.
Protect these functions by only running them when an event widget
is around.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
Instead of having the `GtkListView` create a row for each day containing
their own internal `GtkListBox` to store the event widgets, move the
creation of event widgets to the `GtkListView`'s item factory.
The motivation for this change is having internal listbox's inside a
`GtkListView` is problematic for keyboard navigation, because the user
can either:
- The event widgets in the internal listbox's can not be activated by
pressing Space/Enter on a focused event widget if the listbox row's are set to be focusable.
- If the internal listbox's rows are set to be unfocusable, the user is
not able to navigate the event widgets using the arrow keys, Page
Up/Down or Home/End.
To use `GtkListView:factory` to generate the event widgets, we first
wrap the filtered day model inside the list view around a
`GtkFlattenListModel` to concatenate all the containing
`GcalAgendaViewItem` (which contain a given event and the date it occurs
on) in the day models together. This gives us a model of all events that
can be turned into event widgets, and a model of day sections to create
headers for each day in the next commit.
This approach was taken because we do not get the activated row widget,
unlike with the previously used `GtkListBox` where the row widget is
passed as an argument in `::row-activated`, and there is no feasible
other way to obtain the correct event widget from a `GtkListView`.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
Required some small changes to `gcal-agenda-day-row.c` to keep the
application working - `create_day_row_func` was tweaked to query the
given item for the event, instead of assuming the event is the item
itself. This will be removed (alongside the rest of GcalAgendaDayRow) in
a later commit
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>