Commit Graph
5795 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 2f7dce36e2 core/event-list: Use gdkarrayimpl.c as backing store
GSequence is useful and provides us with a convenient API, however,
it pretty much guarantees cache misses when iterating, lots of pointer
chasing, and scattered memory.

gdkarrayimpl.c works around all of that, at the cost of more expensive
additions and removals. But because we do a lot more lookups compared
to edits, there should still be benefits to it.

Change the backing store to be based on gdkarrayimpl.c.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/757>
2026-05-03 15:29:31 -03:00
Georges Basile Stavracas Neto d207a95656 contrib: Import gdkarrayimpl.c from GDK
We'll use this in the next patch to reimplement GcalEventList.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/757>
2026-05-03 14:56:07 -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
Georges Basile Stavracas Neto 95bc0a8fb2 views/month: Reduce to 3 pages
Now that the timeline handles augmentation, the Month view doesn't need
to fetch so much data at once. Reduce to 3 pages of month rows.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/757>
2026-05-03 14:56:07 -03:00
Georges Basile Stavracas Neto d47358f294 core/manager: Use an augmented timeline
Augment the range of events by a factor of 2.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/755>
2026-05-03 14:01:22 -03:00
Georges Basile Stavracas Neto b353c9f259 core/timeline: Add support for augmented timelines
Augmented timelines increase the range of dates from its subscribers
by the specified factor. They're useful for the interactive views,
since they prevent fetching new events so often as when views change.

Add the necessary API.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/755>
2026-05-03 14:01:22 -03:00
Georges Basile Stavracas Neto 08f3f94ec1 gui/application: Stop weather service on shutdown
Instead of during context finalization, which is too late.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto cd82c2c52c gui/date-chooser: Properly remove idle source
When disposing of the widget, also remove the associated idle source
that might exist. This prevents a crash.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto c084e28400 views/week: Don't deal with events out of range
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto c71fcf7029 views/month: Add "range" property to rows and use it
Use it as the binding source of the GtkExpression for the boolean
filter used to filter the list of events. This allows automatic
filtering when the "range" property changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto afd9f9b954 core/timeline: Remove message queueing and listeners
"Let go and move on." - The Fool?

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto 136fd16a0a gui/date-chooser: Port to GListModel
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto d065d4b9e8 views/agenda: Port to GListModel
This is a major rework of the Agenda view. It splits the view into
GcalAgendaViewDay, which represent a single day with events; and
GcalAgendaViewDayRow, which is the actual widget with a title label,
and a listbox with event widgets.

The Agenda view itself merely manages a list of GcalAgendaViewDays,
and updates them with the events model, and active dates.

This allows us to get rid of the custom listbox row, and the confusing
checks for event widgets, and all the bugs the came with it. It also
allows for removing the internal GcalRangeTree, and delegate all
event management to list models.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:54 +00:00
Georges Basile Stavracas Neto 5c39162f86 core/search-provider: Port to GListModel
No deal

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:53 +00:00
Georges Basile Stavracas Neto fa03c6f9af views/week-grid: Port to GListModel
And, while at it, rewrite the layout algorithm to operate on blocks of
overlapping events, and segmented columns. Like the month view row,
layouts blocks are invalidated at any point in time, but recalculated
immediately before a relayout happens.

The reason for doing such a massive rewrite while in the middle of the
port to GListModel is because it's easier to handle GListModel data
with this approach, than with the previous approach of storing it all
in a GcalRangeTree.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1153
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:53 +00:00
Georges Basile Stavracas Neto 5fe24582d4 core/range-tree: Add gcal_range_tree_has_entries_at_range
It checks if there's any entry in that range. It's a little faster
than gcal_range_tree_count_entries_at_range() because it stops at
the first entry that matches it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:52 +00:00
Georges Basile Stavracas Neto 807f5608b1 search/model: Port to GListModel
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:52 +00:00
Georges Basile Stavracas Neto 34e28e31fe views/week: Port week header to GListModel
Rework the add/remove functions to make them internal. The remove
function can now operate on GcalEvent* instead of gchar* uuid,
since it's not bound to GcalTimelineSubscriber anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:52 +00:00
Georges Basile Stavracas Neto c635db3495 views/week: Port to GPtrArray
GLists are an artifact of times immemorial and we should
avoid using them as much as possible. In this commit, for
example, there were a couple of accidentally quadratic
pieces of code.

Port (mostly of) the week view header to GPtrArray.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:51 +00:00
Georges Basile Stavracas Neto 039b75755e views/month: Port to GListModel
Neutralize the add/remove/update vfuncs (we can't remove them yet).
Pass the event model to the individual week rows, and let them
filter their events using a GtkFilterListModel.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:51 +00:00
Georges Basile Stavracas Neto df8033b3ba core/timeline: Cosmetics
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:51 +00:00
Georges Basile Stavracas Neto 71c5d0b70d core/timeline: Add plumbing for models
Add a GtkFlattenListModel that flattens out all events from the
calendar monitors. Keep a GtkFilterListModel, and a GtkSortListModel,
for each subscriber. Manually update the filter when the range of
the subscriber changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:50 +00:00
Georges Basile Stavracas Neto 5f5e438955 core/timeline-subscriber: Add set_model() vfunc
This is the entry point that will allow views to use models instead
of the manual add/remove/update_events vfuncs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:50 +00:00
Georges Basile Stavracas Neto a303759913 core/timeline: Store calendar monitors in a GListModel
This will allow flattening and merging them.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:50 +00:00
Georges Basile Stavracas Neto cc6736a16f core/calendar-monitor: Implement GListModel
This uses GcalEventList to as the backing store of events, and proxies
the "items-changed" signal.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:49 +00:00
Georges Basile Stavracas Neto 9eea2ee985 core/calendar-monitor: Use NULL-terminated arrays
This will help with next commits

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:49 +00:00
Georges Basile Stavracas Neto 6da43e9353 Introduce GcalEventList
This is a GListModel implementation that is specific to
GcalEvents. Events are stored in a GSequence in order of
date.

Add a couple of tests exercising additions and removals.

WIP: add more tests
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:49 +00:00
Georges Basile Stavracas Neto 4796330de0 core/log: Ignore GWeather messages
Mostly noise, and lots of XML outputs.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
2026-05-03 16:57:49 +00:00
Hari Rana 2bc9c96095 flatpak: Use intltool provided by shared-modules
Launchpad is currently dealing with DDoS issues. The shared-module
repository contains mirrors which can be useful for those who are
unable to build intltool.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/756>
2026-05-03 15:25:44 +00:00
Efstathios Iosifidis d55b35213e Update Greek translation
(cherry picked from commit c499ba7c2ba95cbdd1df949cc621ec930adc23f3)
2026-05-03 05:39:59 +00:00
Aefgh Threenine e1cbf52fe6 Update Thai translation
(cherry picked from commit 1a06db017fe719569723392ff33deacddacbf43a)
2026-05-02 17:04:34 +00:00
Martin 85fe57f8dc Update Slovenian translation 2026-04-29 14:42:08 +00:00
Danial Behzadi 7924404228 Update Persian translation
(cherry picked from commit e90c992b7c5951dddd79ca41091f6bf81f0d22e2)
2026-04-27 23:43:35 +00:00
Antonio Marin c5f79ea664 Update Romanian translation 2026-04-24 09:05:58 +00:00
Jordan Petridis b900a65760 Use standalone Month format when appropriate
Some locales use different strings for the months depending if they are
accompanied by a numberic date or not. When we use the month name as a
standalone, we should use %OB instead to accomodate for these locales.

For more see: https://docs.gtk.org/glib/method.DateTime.format.html

Close #1546

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/705>
2026-04-23 16:28:06 +00:00
Jan-Michael Brummer 63879a0d63 event-widget: Truncate long strings by char not by bytes
Longer text were truncated by bytes instead of chars leading to
invalid text as UTF text sizes are bigger than one byte.
Fix it by using the correct utf8 offset pointer.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/750>
2026-04-23 11:36:00 +00:00
Jan-Michael Brummer 5e30145971 weather-info: Remove duplicate code
gcal_weather_info_get_date is defined twice, remove it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/749>
2026-04-23 11:32:09 +00:00
Jose Riha ef00d2033a Update Slovak translation
(cherry picked from commit 7c1d1b88f696650f3489533d57b518d3c6b9baa7)
2026-04-21 09:20:02 +00:00
Nathan Follens d77c86ffb0 Update Dutch translation
(cherry picked from commit 2ca6a83cd3fccdfe1abd605a07d78ab36184a37b)
2026-04-20 21:11:18 +00:00
Miika Brenna Jarsve 8854cc2358 Update Norwegian Bokmål translation 2026-04-17 07:34:58 +00:00
Antonio Marin 4f019194cf Update Romanian translation 2026-04-11 17:08:05 +00:00
Martin d24abd4687 Update Slovenian translation 2026-04-09 19:42:05 +00:00
Alistair Francis 6c09758633 event-popover: Support the maps URI for opening locations
Open gnome-maps (or other map application) when clicking on a map icon
next to the location address.

Resolves: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/326
Signed-off-by: Alistair Francis <alistair@alistair23.me>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/590>
2026-04-09 12:04:11 +00:00
Jake Dane b0321c369d Replace style-*.css with media queries
Libadwaita 1.9 deprecates using style-dark.css, style-hc-dark.css and
style-hc.css. This moves these styles into style.css and conditionally
loads them using media queries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/745>
2026-04-08 12:19:18 +00:00
Hari Rana 92b74849bf views/month-cell: Add AdwBin as parent to methods retrieving height of widget
This is future-proofing the uncertain decision of removing
GtkWidget's `margin-*` properties in the future, which is what
we're currently using to retrieve the height of certain widgets.

Whenever the intention is to get the entire size of a particular
widget, including properties that contribute to layout such as
margins, the `get_width()`/`get_height()` methods don't include
these properties during calculations. However, getting the size
of the parent widget will include them in its entirety.

As such, the safest path is to use AdwBin as the parent to the
respective widgets, and using it to retrieve the height.

See: <https://gitlab.gnome.org/GNOME/gtk/-/issues/6556#note_2056432>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/739>
2026-04-03 16:37:14 -04:00
Antonio Marin a578d93ce3 Update Romanian translation 2026-04-02 14:33:12 +00:00
Martin 6e085142c1 Update Slovenian translation 2026-04-01 16:42:20 +00:00
Hari Rana 9f8faf0db0 data: Add agenda view screenshot
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/718>
2026-04-01 11:20:44 +00:00
Hari Rana 49e0521b67 views/week-view: Adapt to high contrast
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/710>
2026-03-31 21:55:32 -04:00
Joshua Brot 1baefcc465 gui: Run Blueprint formatter
Reformatting blueprints to align with the updated formatter.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/736>
2026-03-27 18:16:29 -04:00