Commit Graph
457 Commits
Author SHA1 Message Date
Daniel García Moreno adb56d9c29 event-editor: Do not apply section that doesn't changed
Fix https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1028
2023-11-12 21:29:07 +01:00
Daniel Garcia Moreno 6afb5cf3a5 view: Fix daylight saving issue in week view
This patch fixes an issue when creating new events in week view the week
after the daylight saving change.

The problem was in the calc of the selected date, that's done couting
the 30 minutes slots and adding that minutes to the week_start datetime.
When there's a daylight saving change, the real date to select should be
adjusted. This patch adds a new util function to make it easy to add
minutes ignoring the tz so we can make this calc directly with
gcal_date_time_add_floating_minutes.

This also includes a new test file with some checks for the new util
function and spring / autumn changes.

This new function could be used in other places to fix specific issues
that could be caused by the same logic error, calculate a selection or
event position based on GDateTime operations.

Fix https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/482
2023-11-09 13:17:20 +00:00
Hari Rana 518de4eb93 help-overlay: Add menu shortcuts 2023-11-07 19:05:12 +00:00
Hari Rana af6ea3bbda calendar-button: Add mnemonic for Manage Calendars 2023-11-07 18:56:30 +00:00
Georges Basile Stavracas Neto 82a6fa364e event-editor/date-selector: Use portal for week dates
Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1022
2023-11-07 18:55:05 +00:00
Georges Basile Stavracas Neto ab714d6f39 gui/event-popover: Show at the top
Seems slightly less worse than showing at the sides of the event.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1006
2023-10-18 15:51:32 -03:00
Georges Basile Stavracas Neto 4fb2cd87b0 event-popover: Rework spacings
This allows the scrolled window to have infinite borders
2023-10-18 15:47:46 -03:00
Georges Basile Stavracas Neto ddaf0e17a4 views/month: Create timed ranges
This allows proper range comparisons.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1106
2023-09-28 13:21:30 -03:00
Georges Basile Stavracas Neto 3ff57f71e4 views/month: Dispose overflow popover 2023-09-28 11:52:40 -03:00
Georges Basile Stavracas Neto e9ab7effad calendar-management/edit: Remove unnecessary binding
This is handled by the C code now.
2023-09-28 11:52:11 -03:00
Georges Basile Stavracas Neto 27ee81b072 views/month: Only diff when current range exists
Right after bring created, the current date - and consequently
the range - is NULL. We shouldn't diff in this case.
2023-09-28 11:25:27 -03:00
Georges Basile Stavracas Neto 9a665a94c7 application: Add message when running as a service 2023-09-28 11:19:23 -03:00
Georges Basile Stavracas Neto 38108ffa7a event-widget: Fetch 24h setting from context
Instead of using the auxiliary function.
2023-09-23 02:39:07 -03:00
Georges Basile Stavracas Neto c8543aa822 views/week/header: Use en dash
Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1107
2023-09-22 11:47:47 -03:00
Georges Basile Stavracas Neto a7f798a815 views/month: Use en dash
Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1107
2023-09-22 11:45:47 -03:00
Georges Basile Stavracas Neto 77c908b394 event-widget: Properly unparent preview popover
GcalEventWidget currently doesn't track the preview popover, and
that can easily crash Calendar upon destruction.

Track that, and unparent on dispose.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/986
2023-09-14 12:09:11 -03:00
Georges Basile Stavracas Neto 8d79fe2ffd views/month: Demote assertion to regular check
We can have a NULL selection start, when starting the drag on the
header section.
2023-09-13 18:34:22 -03:00
Georges Basile Stavracas Neto dd61f8ef6f views/month/row: Adjust for exclusive end date
Subtract a second from the end date so we can properly compare dates.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1098
2023-09-13 14:25:45 -03:00
Georges Basile Stavracas Neto f1767037ac views/month: Clear selection after showing overflow
This should prevent selection after clicking any overflow button.
2023-09-13 09:17:12 -03:00
Georges Basile Stavracas Neto ad34aa40fc views/month: Add header above week rows
Otherwise GTK4 will pick the rows, even when they're clipped.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1095
2023-09-09 20:14:39 -03:00
Georges Basile Stavracas Neto 5503e5ca50 views/month: Handle reduced animations setting
Move rows slightly faster in that case.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1080
2023-09-02 10:28:39 -03:00
Georges Basile Stavracas Neto 20ad7f3676 views/month: Reset offset when animation is done 2023-09-02 10:26:41 -03:00
Georges Basile Stavracas Neto b0813fb605 month-view-row: Clamp last cell to [first cell, 6]
This is not ideal but it's what we've got for now.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1083
2023-09-02 10:26:41 -03:00
Georges Basile Stavracas Neto e3a350126b gui/month-cell: Accept drops from other months
We support that now fairly easily, let's enable it.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1077
2023-08-25 18:07:04 -03:00
Georges Basile Stavracas Neto da84b727b3 core/subscriber: Pass old event on update
Now that we keep precise control over GcalEvent instances, and
can use simple pointer comparisons everywhere, GcalMonthView
implemented its update function as a simple remove + add pair.

The problem is that we're not passing the old event instance,
so removals never actually happen, since the new instance is
not yet available to subscribers.

Pass old event in additio to the new one, and use it where it
makes sense.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1073
2023-08-18 10:41:41 -03:00
Georges Basile Stavracas Neto bd989aae66 views/month: Implement event creation flow
Add a click gesture to detect when we have to start monitoring
cursor motion. Also add a motion event controller to react to
cursor motion, and enable and disable the this motion controller
on button press and release, respectively.

Selection is implemented as a pair of GDateTimes stored in the
month view struct. Whenever a selection begins, the start date
is set; the end date is only set when moving the cursor. It is
valid to have a start of the selection, and no end (meaning, a
1 day selection); it is, however, forbidden to have an end but
not a start.

Future improvements can be added later, such as scrolling when
moving the cursor close to the edges of the month view. We're
gonna have to live without that for now though.

Implement the GcalView.clear_marks vfunc now that we have a
selection to operate on.
2023-08-17 21:13:54 -03:00
Georges Basile Stavracas Neto ded56392ef views/month: Use inclusive week end to format title
Otherwise we end up with D+1 in the last date.
2023-08-17 19:41:55 -03:00
Georges Basile Stavracas Neto 0e4c4d5177 views/month: Use month and year rangers in titles 2023-08-17 18:46:52 -03:00
Georges Basile Stavracas Neto 632484b719 month-cell: Cleanup unused function
We handle weather internally now, no need to expose a function to
set that.
2023-08-17 18:28:30 -03:00
Georges Basile Stavracas Neto 4a2412897a month-cell: Bring back weather information
Now GcalMonthCell handles it internally, instead of receiving the
weather information from the parent view.

This is a modified version of a patch originally written by
camelCaseNick.
2023-08-17 18:27:05 -03:00
Georges Basile Stavracas Neto dabbc597d9 month-cell: Show month name on the 1st day
This helps differentiate when the month change happens.
2023-08-16 21:21:47 -03:00
Georges Basile Stavracas Neto 28ee1e1244 month-cell: Add 'numeric' CSS class
Gives us a nice consistent look
2023-08-16 21:21:47 -03:00
Hari Rana d80536c83b summary-section: Remove find-location button 2023-08-15 18:28:58 -04:00
Georges Basile Stavracas Neto f1f9d83943 views/month: Implement get_children_by_uuid
Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1057
2023-08-14 14:57:51 -03:00
Georges Basile Stavracas Neto 1fd984306f views/month: Animate discrete scrolls
When scrolling with a scroll wheel, animate towards a target
row. If multiple scrolls happen before the animation completes,
change the target row of the animation.
2023-08-13 18:37:12 -03:00
Georges Basile Stavracas Neto 8f04f40272 views/month: Factor out row offsetting in a function
And use it in the pixel-based variant.
2023-08-13 18:37:12 -03:00
Georges Basile Stavracas Neto 12a9e8193f views/month: Rename a function
We'll introduce a variant of this function that operates directly
on row offsets, instead of pixel values.
2023-08-13 18:37:12 -03:00
Georges Basile Stavracas Neto da2b7328e0 views/month: Implement event updates
Just do a stupid remove + add, which is far from ideal but will
be enough for the time being.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 95cc40d8a8 window: Use non-deprecated function
gtk_widget_compute_point() is the hot new thing.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 77f355ed53 month-cell: Small style improvements
As suggested by Allan.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 176f8f28a8 views/month: Show overflow popover when requested
Basically, all that we used to do, but written in a different
way for the new month view.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 15032b6d05 month-view-row: Add 'show-overflow' signal
It just proxies the day cell's signal.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 57fa7b2d48 window: Compare week for month view too
The new month view operates on week rows, so it makes sense to
perform the same check than that of the week view.

https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1063
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto d5a36d4ad2 view: Operate on ranges
This is the data struct we should be using everywhere now.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 9b343db339 views/month: Improve date calculation for cell style
Use the center the view as the date with which the day cells
are styled. This should be enough to highlight the month with
most days visible onscreen.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto e7846a6b9c views/month-view: Change visuals of out-of-month day cells
This still looks like garbage becase of the rudimentary way we
compute the current date, but it's a start.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 7e26bd5649 views/dazzling: Make it *the* month view
And move the old one to the attic. I'll keep the files around for
a while.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 7f7f55826c month-view-row: Implement RTL support
This was remarkably easy.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto 5bc8fffc71 views/dazzling: Add cached events to shuffled row
Cached events won't be readded by the backend, because they're
alread present in the view, so we have to manually add them to
the rows.
2023-08-11 15:13:44 -03:00
Georges Basile Stavracas Neto ac3998f07d month-cell: Add padding beneath day number
We need to breathe!
2023-08-11 15:13:44 -03:00