Commit Graph
1038 Commits
Author SHA1 Message Date
Hari Rana 6cd8d631f5 event-editor/event-editor-dialog: Rename set_event() to present_event()
This allows us to avoid using `adw_dialog_present()` every time
`set_event()` is being invoked.

All the files using `set_event()` are updated accordingly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/711>
2026-06-26 08:08:39 -04:00
Hari Rana a0b8f4b23e event-editor/event-editor-dialog: Remove unused struct members
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/784>
2026-06-26 07:54:24 -04:00
Hari Rana 8aa3b7442b event-editor/summary-section: Remove automatic focus grabbing when setting event
This is no longer needed as it was replaced by the
`grab_focus()` override.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/782>
2026-06-25 07:39:38 -04:00
Hari Rana 35580dc40c event-editor/event-editor-dialog: Explicitly grab focus on summary section
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>
2026-06-25 07:39:38 -04:00
Hari Rana 3271974b95 event-editor/summary-section: Override grab_focus()
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>
2026-06-25 07:39:38 -04:00
Hari Rana 3c67de4076 event-editor/attendee-details-page: Use AdwPreferencesGroup API
AdwPreferencesGroup now has the `bind_model()` method, so it's
best to just use that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:35 -04:00
Hari Rana cda1362c59 event-editor/event-editor-section: Add AdwPreferencesGroup as prerequisite
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:35 -04:00
Hari Rana 240dc649ce event-editor/summary-section: Inherit AdwPreferencesGroup
This is a prerequisite to make GcalEventEditorSection require
inheriting AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:35 -04:00
Hari Rana cbee9bbb60 event-editor/schedule-section: Inherit AdwPreferencesGroup
This is a prerequisite to make GcalEventEditorSection require
inheriting AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari Rana 60c9989e4b event-editor/attendees-section: Inherit AdwPreferencesGroup
This is a prerequisite to make GcalEventEditorSection require
inheriting AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari Rana c595d8a6e8 event-editor/reminders-section: Inherit AdwPreferencesGroup
This is a prerequisite to make GcalEventEditorSection require
inheriting AdwPreferencesGroup.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari Rana fbea369c0f event-editor/notes-section: Inherit AdwPreferencesGroup
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>
2026-06-23 14:10:34 -04:00
Hari Rana 568227346b event-editor/event-editor-dialog: Port to AdwPreferencesPage
Our use case is already handled by the `AdwPreferencesPage:banner`
property, which allows us to port the dialog to AdwPreferencesPage.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:34 -04:00
Hari RanaandJamie Gravendeel 4f037132fe event-editor/schedule-section: Use separate-rows property in all-day section
`separate-rows` already does what we want, and using that property
allows us to nesting AdwPreferencesGroup into a GtkBox widget.

Co-authored-by: Jamie Gravendeel <me@jamie.garden>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 14:10:28 -04:00
Hari Rana 8bbaeb754b event-editor/schedule-section: Use AdwInlineViewSwitcher
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/781>
2026-06-23 13:02:50 -04:00
Hari Rana 701c6e3cb5 event-editor/event-editor-dialog: Install actions in widget class
This is a prerequisite in order to enable/disable actions using
`gtk_widget_action_set_enabled()`, is something we'll be making
use of in the future.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/779>
2026-06-23 12:55:12 -04:00
Hari Rana 3d768fa748 event-editor/attendee-row: Remove unused GtkBox
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/779>
2026-06-23 12:55:12 -04:00
Hari Rana eff6aeb6d6 event-editor/attendee-details-page: Chain up finalize()
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/779>
2026-06-23 12:55:12 -04:00
Hari Rana 48d7037311 about: Explicitly state when app is not contained inside Flatpak
At the moment, whenever the user is not running under Flatpak,
the "Flatpak:" label won't show up, which confused me for a moment
when looking at https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1609,
as I assumed the "Flatpak:" label showed up whether it was running
under Flatpak or not, making me assume that they did not go in the
Troubleshooting section.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/777>
2026-06-19 13:10:17 -04:00
mindonwarp 7baed29551 event-editor: Remove dead code
Looks like the gcal-time-chooser-row.blp was resurrected from a
forgotten .ui file with "blueprint-compiler port". The .ui and .h were
not removed with !516

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/775>
2026-06-07 09:23:34 +02:00
SShubham1 cb0ec97653 calendar-list: move previous/next week with PgUp/PgDown via ShortcutController
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>
2026-05-28 14:10:08 +00:00
Hari Rana 4f9cba85fb views/month-view: Set ceiled height of each row
Fixes: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1290>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/772>
2026-05-28 06:27:37 -04:00
Hari Rana 7ebd9f2744 views/month-view-row: Add property to negate the compensated pixel
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/772>
2026-05-28 06:27:37 -04:00
Jan-Michael Brummer ef5935f1fa event-popover: Add support for Teams links
Add a separate function to extract the description and the URL from a
Teams-formatted event. Add a test for this as well.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1312
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/753>
2026-05-26 19:55:25 -03:00
Hari Rana 1dcec8d2b5 event-editor/notes-section: Follow AdwEntryRow's style
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>
2026-05-25 07:07:53 -04:00
Georges Basile Stavracas Neto 5a693f2a25 views/month: Port to GListModel
This was an oversight from the original MR.

Pass the GListModel to the month popover, and let it filter itself
out. Use GtkListBox model utilities for automatically managing the
event widgets.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/work_items/1582
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/767>
2026-05-20 14:33:13 -04:00
Georges Basile Stavracas Neto 59ee1db556 views/month: Show first invisible rows above and below
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>
2026-05-20 18:26:37 +00:00
Georges Basile Stavracas Neto c9c455b6d8 views/month: Only recalculate layout blocks when needed
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>
2026-05-20 13:45:52 -03:00
Georges Basile Stavracas Neto 298593456a view/month: Drop GtkBoolFilter from rows
They're slower and showed up in the profilings. Use a custom filter
for now.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/765>
2026-05-19 19:25:49 -03:00
Georges Basile Stavracas Neto f40c2cb0e9 gui/fading-label: Rewrite using PangoLayout directly
Instead of an internal label widget, store the text and the PangoLayout
directly, and only render them. Cache as much as possible to avoid
font reshaping.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/765>
2026-05-19 19:25:25 -03:00
Georges Basile Stavracas Neto 601acef508 views/month: Use variable for better readability
The second part of the if condition is not obvious, so use a variable
with a proper name to make it easier to understand.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:10 +00:00
Georges Basile Stavracas Neto 573e1dc042 views/month: Simplify layout blocks recalculation
We can merge two of the three branches, and thus cleanup a function
that is only used there.

Suggested by Hari.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:10 +00:00
Georges Basile Stavracas Neto c609f281dc gui/event-widget: Mark properties as explicit-notify
A small correctness change. Suggested by Hari.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:10 +00:00
Georges Basile Stavracas Neto c0127fa2af views/week-header: Reuse event widgets using the new pool
Same deal as the Month view.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:10 +00:00
Georges Basile Stavracas Neto bbc041eed9 views/month: Recycle event widgets using the pool
Create a new GcalEventWidgetPool shared between all month view rows.
The event widgets are distributed to rows as needed.

When rows are done with the event widget, the give them back to the
pool so that other rows can reuse them.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:10 +00:00
Georges Basile Stavracas Neto 3692747362 views/week-grid: Reuse event widgets
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:10 +00:00
Georges Basile Stavracas Neto 4205e08be6 views/month: Reuse event widgets
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:10 +00:00
Georges Basile Stavracas Neto 59cae05929 gui: Introduce GcalEventWidgetPool
This is a helper object that preallocates a number of event widget,
and then gives them away to consumers. When consumers are finished
using the event widget, instead of simply destroying it, they can
return the widgets to the pool, so it can be further reused.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:09 +00:00
Georges Basile Stavracas Neto 9ef437009f gui/event-widget: Make event setter public
And make the "event" property read-write and not construct-only.

This will be useful for recycling event widgets later.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:09 +00:00
Georges Basile Stavracas Neto 3104f16f7c gui/event-widget: Connect to signals using GSignalGroup
It'll make it easier when making the "event" property mutable later
on.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:09 +00:00
Georges Basile Stavracas Neto e4d1fdf13c gui/event-widget: Use more bindings in the UI file
Instead of manually connecting to signals and binding to properties
in code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/758>
2026-05-19 22:20:09 +00:00
Georges Basile Stavracas Neto 378b7f6075 views/month: Remove unused field
The hash table is not used since we moved to list models.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/761>
2026-05-05 21:37:05 -03:00
Georges Basile Stavracas Neto 64efb3a06b views/month: Completely hide invisible rows
Instead of just skipping painting. This should remove rows and event
widgets from the CSS tree, avoid measurements and relayouts, and a
few other benefits.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/761>
2026-05-05 21:36:58 -03:00
Georges Basile Stavracas Neto 32d962aa8d gui/event-widget: Remove useless queue_draw
We use a label these days, no need for manual drawing code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/761>
2026-05-05 21:36:48 -03:00
Georges Basile Stavracas Neto c62af398e5 gui/event-widget: Remove unused fields
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/761>
2026-05-05 21:36:42 -03:00
Georges Basile Stavracas Neto bfc4a7dc62 gui/event-widget: Use modern practices for properties
Use a property array, install them all at once, and notify using
g_object_notify_by_pspec().

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/761>
2026-05-05 21:36:36 -03:00
Hari Rana 8629b1f422 views/month-cell: Create activation signal and shortcuts from utility function
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/747>
2026-05-04 10:42:02 +00:00
Hari Rana c507fb23af gui/event-widget: Create activation signal and shortcuts from utility function
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/747>
2026-05-04 10:42:02 +00:00
Georges Basile Stavracas Neto 16a67b7f60 views/week-header: Use gdkarrayimpl.c as backing store
Same deal. It's faster.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/757>
2026-05-03 15:30:20 -03:00
Georges Basile Stavracas Neto c9c4f1c046 gui/window: Only add Agenda view to timeline when visible
There's no point in adding the Agenda view to the timeline when it's
invisible, it just causes invisible and unnecessary event widget
recreation.

Add it lazily to the timeline, when the page visibility changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/757>
2026-05-03 14:56:07 -03:00