Commit Graph
3500 Commits
Author SHA1 Message Date
Zelda Ahmed 4ea2fcfcbe guis/views: Introduce GcalAgendaViewItem
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>
2026-09-26 13:02:27 +01:00
Niklas Wimmer cf0a0835c1 calendar-management: Reduce online page to online calendars
Removes all UI and logic for local calendars from the
new-online-calendar page. This is now handled by the
new-local-calendar page.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
Niklas Wimmer 85ec836d04 calendar-management: Reduce local page to local calendars
Removes all UI and logic for online calendars from the
new-local-calendar page. This is now handled by the
new-online-calendar page.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
Titouan Real 8a21b82e42 calendar-management: Replace bottom button with menu
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>
2026-09-26 00:04:12 +00:00
Niklas Wimmer 736b724d24 calendar-management: Remove new-calendar page
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>
2026-09-26 00:04:12 +00:00
Niklas Wimmer 06910d9a89 calendar-management: Add new-online-calendar page
This is a copy of the existing new-calendar page, but with a
different class name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
Niklas Wimmer 4a5211b7a8 calendar-management: Add new-local-calendar page
This is a copy of the existing new-calendar page, but with a
different class name.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
2026-09-26 00:04:12 +00:00
ARAKHNID ff2689b0f2 gui/event-editor/date-time-chooser: Exit if 12-hour time entry is invalid
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>
2026-09-25 23:55:31 +00:00
Hari Rana bf8e9929e3 views/month-cell: Unstyle cells when overflow button is focused
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/835>
2026-09-25 19:13:29 +00:00
Hari Rana 02ad105088 views/month-view: Avoid selecting cells when pressing overflow button
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/835>
2026-09-25 19:13:29 +00:00
Hari Rana f91e21aaa9 common/date-chooser: Add row and column spacing
This adds back the spacing lost by the removal of margins
in the previous commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:12 +00:00
Hari Rana 7c65f6a0ff event-editor/multi-choice: Remove margins
The margins applied in CSS caused some issues with alignment,
specifically in popovers where they would make the popover
wider than needed.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:12 +00:00
Hari Rana 05ec02fadb event-editor/multi-choice: Replace GtkToggleButton with AdwBin
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>
2026-09-25 19:09:12 +00:00
Hari Rana 1748014028 event-editor/multi-choice: Consolidate state flag changes
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:12 +00:00
Hari Rana c3d5c777ec event-editor/multi-choice: Port from GtkEventControllerKey to shortcuts
Since we wrap the values all the time now, this also removes
the `gtk_widget_error_bell()` call.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:11 +00:00
Hari Rana 34be5e4663 event-editor/multi-choice: Inherit GtkWidget
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>
2026-09-25 19:09:10 +00:00
Hari Rana f20c9235ce event-editor/multi-choice: Port to GtkPopoverBin
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/841>
2026-09-25 19:09:10 +00:00
Hari Rana 65896c6ece utils: Prefix macros with GCAL_
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/842>
2026-09-20 12:44:24 +00:00
Hari Rana 117c032d95 utils: Prefix every function with gcal_util_
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/842>
2026-09-20 12:44:24 +00:00
Hari Rana 38ad6ea3ea utils: Remove unused functions
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/842>
2026-09-20 12:44:23 +00:00
Hari Rana 307f4e78e7 event-editor/multi-choice: Use standard enum members in properties
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 15:07:03 -04:00
Hari Rana 99463b9a62 event-editor/multi-choice: Set accessible label without connecting signal
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:05 -04:00
Hari Rana 2bab7bdc3a event-editor/multi-choice: Remove animate property
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>
2026-09-19 11:54:05 -04:00
Hari Rana 3185997f38 event-editor/multi-choice: Remove wrap property
We no longer have a use case which requires us to keep the
`wrap` property to FALSE, so this patch removes that property
while keeping the wrap behavior.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:04 -04:00
Hari Rana d1e9443b62 common/date-chooser: Remove animate property
We no longer use this property per the previous commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:04 -04:00
Hari Rana 681e24a772 common/date-chooser: Remove wrap property
This no longer exists per the previous commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:04 -04:00
Hari Rana b8e06d32a1 event-editor/multi-choice: Remove unused overrides
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:04 -04:00
Hari Rana 14c20483ae event-editor/multi-choice: Use G_DEFINE_FINAL_TYPE_WITH_CODE()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/840>
2026-09-19 11:54:01 -04:00
Hari Rana 0d1d339581 views: Document transfer none in gcal_view_set_date()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/838>
2026-09-19 09:12:05 -04:00
Hari Rana 2f393ab117 views/month-view: Free GDateTime when setting active date
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/838>
2026-09-19 09:08:56 -04:00
Hari Rana dfb9ea645c common/date-chooser: Use GcalGizmo
GcalGizmo allows us to handle focus within child widgets
much more cleanly, as it no longer requires us to override the
ancestor and re-iterating through children.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/760>
2026-09-16 12:22:36 +00:00
ARAKHNID 2c4faa8f3a date-chooser: Clamp to first day of month when clicking previous/next buttons
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>
2026-09-16 12:00:33 +00:00
Georges Basile Stavracas Neto c534f00366 event-widget: Rework transparency of past events
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>
2026-09-16 11:57:32 +00:00
Brage Fuglseth 2a3e1b02b5 utils: Use correct URL for GNOME Meet
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/834>
2026-09-16 07:07:37 -04:00
Georges Basile Stavracas Neto e7f284ae27 51.0 2026-09-13 17:37:54 -03:00
Hari Rana 89ff82924b gui/gizmo: Introduce GcalGizmo
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>
2026-09-09 14:57:14 -04:00
Hari Rana 9838bbee11 gui/application: Add support URL to about dialog
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/823>
2026-09-03 15:48:12 +00:00
Hari Rana a64e3b59a2 gui/calendar-list: Remove calendar-list style class
This fixes a bug where the calendar list in the sidebar would not
change the background color when hovering over a calendar.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/824>
2026-08-31 13:45:30 +00:00
Maximiliano Sandoval 28e0b65017 Stop using G_GNUC_CONST in _get_type functions
As per g_type_ensure's documentation it is incorrect to mark _get_type
functions with G_GNUC_CONST since they have side-effects on their first
run.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/5223 for more
details.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/819>
2026-08-29 11:06:13 +00:00
Georges Basile Stavracas Neto 176d29260e 51.rc
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/818>
2026-08-28 19:31:18 -04:00
Felipe Alves pipe-felipe 56128e0574 views/week-view: Fix inverted Ctrl+scroll zoom direction
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>
2026-08-28 22:01:23 +00:00
Hari Rana 1b10e66078 gui/event-widget: Guard event popover's pointing coordinates on multi-day events
A follow-up on https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/677#note_2628484,
which prevents the event popover from pointing outside the event
widget's boundaries on multi-day events when activated before exceeding
the drag threshold:
https://docs.gtk.org/gtk4/property.Settings.gtk-dnd-drag-threshold.html

This is mainly useful for people who fidget and may sloppily
click and drag event widgets (before triggering the drag operation),
causing the popover to place itself in unpredictable locations.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/697>
2026-08-28 21:55:35 +00:00
tytan652 d1a400c856 utils/source-discoverer: Allow ICS with LF line breaks
RFC 5545 states that CRLF line breaks should be used but other consumer
seems to allow CR being missing.

https://datatracker.ietf.org/doc/html/rfc5545#section-3.1

Note, that the check result was ignored if the content-type is
text/calendar.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/814>
2026-08-28 21:51:52 +00:00
Anthony Zang 7693feb248 views/month: Cancel active animation before starting new ones
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>
2026-08-28 21:48:26 +00:00
Hari Rana b2b6002573 views/month-view: Skip view when tabbing backward with Control on event widget
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>
2026-08-26 21:16:41 -04:00
Hari Rana 3c044ce77c views/month-view: Skip view when tabbing with Control on month cell
We want to skip the entire view, because, otherwise, it runs
gcal_month_view_row_focus_underlying_cell().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/817>
2026-08-26 21:11:15 -04:00
Hari Rana e1bc583597 views/month-view: Use debug messages
Given the complexity of keyboard navigation in the month view, it
may be useful to rely on debug entries/exits to debug edge cases.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/817>
2026-08-26 20:08:28 -04:00
Hari Rana 2e5379982b views/month-view-row: Replace "adjacent with "overlaying" event
"Adjacent" is incorrect because we are focusing the event that is
in front of the month cell.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/816>
2026-08-25 22:02:50 -04:00
Hari Rana 14869fa02b views/month-view-row: Replace "adjacent" with "underlying" cell
"Adjacent" is incorrect because we are focusing the cell that is
behind the event widget.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/816>
2026-08-25 22:02:50 -04:00
Hari Rana 11e4d8ee8d views/month-view: Allow focusing adjacent event widget from cell
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/741>
2026-08-25 15:42:59 +00:00