Commit Graph
2422 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto a0963c0d36 calendar-monitor: Properly update and delete recurrent events
When we receive the 'objects-modified' signal, we get components
that may represent main events. We also may receive components
that have no recurrency because they were just changed from being
recurrent to non-recurrent.

We need to handle all these cases properly.

If the event has no recurrency set, remove any potential old
recurrence instance lingering around. If we're changing an event
with recurrency, make sure the recurrency instances are in sync
with the new recurrency.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/881
(or so I hope.)
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 16b9337e3f calendar-monitor: Move events hash table to shared section
We'll start accessing the hash table from multiple threads, so
it must be in the shared section of the structure, and it must
be encapsulated by locking.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 791d443c54 calendar-monitor: Simplify locking code a bit
Use GRWLock*Locker to simplify the locking code in a couple of
places.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto 5f67c55304 calendar-monitor: Replace mutex by a rw-lock
This will be more appropriate once we start accessing the events
hash table from the monitor thread.
2022-10-17 23:37:13 -03:00
Georges Basile Stavracas Neto baacf696a6 calendar-monitor: Shuffle some variables around
Move them to where they're used.
2022-10-17 23:37:13 -03:00
Ray Strode 184d77ef4d window: Fix crash in toast animation
Every once in a while when I'm deleting an event gnome-calendar crashes.

I dug in a bit, and it seems the reason is
adw_toast_overlay_add_toast takes ownership of the passed in reference.

This is a little idiosyncratic for something that's not GInitiallyUnowned,
but it appears to be the API nonetheless.

GCalWindow assumes it owns the reference.

This commit makes both users of the toast happy by adding a ref call.
2022-10-14 13:38:03 -04:00
Yosef Or Boczko 17bb795846 gcal-week-grid: Fix wrong x postion for events in RTL
Every event in RTL languages is drawn in the
wrong place. As a result the week view is totally unusable.

Fix this.

#817

Signed-off-by: Yosef Or Boczko <yoseforb@gmail.com>
2022-10-12 20:35:52 +03:00
Milan Crha 11a34a1d28 Misc: Fix GObject property types for GLabel::xalign/yalign properties
When running under valgrind, it claims that there's used uninitialized
memory, which is set as GObject property in the code. It's for
GtkLabel::xalign. The problem was that the value in the code is
an integer, but the property itself expects float type. This fixes
the place and where a floating point is already used it annotates
the value to be float, not a double.
2022-10-06 13:36:10 +02:00
Milan Crha 8138619419 gcal-window: Event deletion aborts unfinished previous delete attempt
Cannot use g_clear_pointer() here, because it unsets the pointer first and
only then calls the free function, which means the test on self->delete_event_toast
NULL-ness would be satisfied in the on_toast_dismissed_cb(), thus the previous
event delete attempt would be "cancelled" internally.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/858
2022-10-05 18:44:25 +02:00
Milan Crha 5e72aa53f2 gcal-event-editor-dialog: Use user-chosen mode in on_ask_recurrence_response_save_cb()
...to do what the user asked for.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/871
2022-10-05 15:39:57 +00:00
Milan Crha df3587752d gcal-month-view: Use gcal_view_set_date() to update date on scroll
This way the content of the view is updated properly, otherwise only
internal GDateTime structure had been updated, but not the view itself.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/868
2022-10-05 15:10:47 +00:00
Milan Crha 15ce841a6c gcal-date-chooser: Update also combined_choice in set_date()
Thus it's in sync with the rest of the date chooser.

Also use a common function to replace `self->date` value.

Related to https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/868
2022-10-05 15:10:47 +00:00
Milan Crha d273b4304f gcal_set_date_time: Avoid possible use-after-free
When the `*dest` and `src` are the same, doing g_date_time_unref()
can free the instance before it's assigned back to the `*dest`.
2022-10-05 15:10:47 +00:00
Florian Müllner 80d803d125 date-chooser: Update combined-choice on date changes
Otherwise the header will not reflect the active date.

https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/876
2022-10-05 14:59:22 +00:00
Georges Basile Stavracas Neto fb1ca515e9 agenda-view: Fix translatable strings 2022-09-15 12:30:13 -03:00
Christopher Davis a53787457e window: Use two today buttons instead of moving
This fixes an issue that caused flickering as the window
approached a size where it could fold.
2022-08-12 03:00:08 +00:00
Christopher Davis 04ead5fe85 window: Update today action enabeld state instead of button sensitivity
Button sensitivity is automatically updated with action state.
By taking advantage of this we can use the `win.today` action
on multiple buttons without needing to update every button.
2022-08-12 03:00:08 +00:00
Christopher Davis 9444d998ff general: Use GcalToolbarEnd for toolbars
For the sake of smooth adaptivity, we need the toolbar buttons
to be constant in both modes instead of moving places from one
mode to another. Instead of duplicating these groups of
buttons, we can refactor them into an object for toolbars
and use them in multiple places.

This commit takes the widgets from the end of the header bar and
creates `GcalToolbarEnd`, which is used in the header bar and the
mobile action bar.
2022-08-12 03:00:08 +00:00
Christopher Davis 78d9dd1e8e window: Move action widgets at small widths
Moves the action widgets (Today, New Event, Search) to an
action bar when the window shrinks.
2022-08-12 03:00:08 +00:00
Christopher Davis 4cc727f48d window: Use AdwLeaflet for foldable window
Allows the window to shrink to a smaller width via AdwLeaflet.
2022-08-12 03:00:08 +00:00
Christopher Davis 117611ac1d application: Port to AdwAboutWindow 2022-07-15 00:51:20 +00:00
Christopher Davis 905128cc69 event-editor: Use AdwEntryRow 2022-07-07 12:53:22 -04:00
Adrien Plazas 6b39f7552b week-view: Allow zooming with Ctrl+Scroll
So it's possible to zoom even if the device doesn't support pinching to
do so.
2022-06-23 19:29:17 +02:00
Adrien Plazas 7b19a0fca7 week-view: Split zooming into dedicating functions
This will help zooming with in other ways like Ctrl+Scroll.
2022-06-23 17:09:15 +00:00
Adrien Plazas bed7f9e027 event-widget: Use .dim-label instead of a hard-coded opacity
This uses the standard opacity for events of lower importance and
ensures the opacity difference is lower in HighContrast, helping
accessibility.
2022-06-23 16:51:56 +00:00
Georges Basile Stavracas Neto 4c9e7a2d03 manager: Bring back credentials 2022-06-23 13:50:20 -03:00
Adrien Plazas f7ef1aea65 event-widget: Fix the indentation
It was purposefully left broken in the previous commit.
2022-06-22 12:49:38 +00:00
Adrien Plazas b68f7a0083 event-widget: Style overhaul
This reworks the style of the event widgets to make them match the
latest designs. This also supports the light and dark theme preferences
and fixes some spacing inconsistencies and errors.
- The orientation of events only affects how their content is laid out,
  not their style.
- Events are fully colored accordingly to their calendar's color.
- Timed events have a semi-transparent background and a kind of opaque
  knob on their left.
- Timed events have their text colored according to the theme.
- Lasting events are fully opaque, with no knob.
- Lasting events have their text colored according to their calendar's
  color.

This purposefully leaves the indentation broken to help reviewing the
changes.
2022-06-22 12:49:38 +00:00
Adrien Plazas 40ce81f81a Use the Libadwaita style loading mechanism
This simplifies the code and will help support the dark and high
constrast variants.
2022-06-22 12:49:38 +00:00
Adrien Plazas f0021fcffb week-view: Add a zoom gesture
This will help the week view work well on small touchscreens and it also
works with touchpads.
2022-06-22 12:04:21 +00:00
Milan Crha 0bd11799dc Port to libsoup3 2022-06-22 08:51:30 -03:00
Cleo Menezes Jr 0fa383a14a new-calendar-page: fix Calendar files are not shown 2022-06-22 01:26:50 -04:00
Abdullahi Usman be0a2312d9 search-model: check for duplicate events in search bar 2022-06-21 12:28:54 +00:00
Adrien Plazas fd2b0a96a5 Drop the unused calendar-year-symbolic icon
This icon was left unused since we removed the year view.
2022-06-20 09:19:45 +02:00
Adrien Plazas 48ab4baa98 calendar-button: Restyle
This gives it a label and an arrow to match the new design.
2022-06-16 08:34:27 -03:00
Adrien Plazas e24f1812d6 window: Fix the indentation
It was purposefully left broken in the previous commits to help
reviewing the actual changes.
2022-06-16 08:34:27 -03:00
Adrien Plazas e611580ef3 window: Reorganize buttons
This matches the new design.
2022-06-16 08:34:27 -03:00
Adrien Plazas 54a8445abb window: Drop the back and forward buttons
They aren't needed anymore as we have a date chooser, and they are
absent from the new design.
2022-06-16 08:34:27 -03:00
Adrien Plazas a3f21be8b4 window: Add a sidebar with a date chooser and an agenda
This starts implementing the sidebar of the new design.
2022-06-16 08:34:27 -03:00
Adrien Plazas 3c37304e54 window: Move the toast overlay at the root of the window
This is needed to add a sidebar.
2022-06-16 08:34:27 -03:00
Adrien Plazas 06aab9952a Add GcalAgendaView 2022-06-16 08:34:25 -03:00
Adrien Plazas cb439095a5 event-widget: Add the timestamp-policy property
This gives some control on what time is displayed on the widget. It will
be used to show the time of the end of an event in the agenda view.
2022-06-16 08:23:45 -03:00
Adrien Plazas 0d27b08803 event-widget: Set the squeezer's margin via CSS
This ensure the style is consistent and updates itself automatically as
the CSS classes change, and also makes the code simpler.
2022-06-16 08:23:45 -03:00
Adrien Plazas 4cf8b51de1 enums: Add the GcalTimestampPolicy enum
This will be used to control more freely what timestamp is shown on
event widgets.
2022-06-16 08:23:45 -03:00
Adrien Plazas 051212f44b multi-choice: Fix the indentation
It was left purposefully broken in the previous commit.
2022-06-16 08:23:45 -03:00
Adrien Plazas b031c9591a multi-choice: Add the popover property
This allows a multi choice's label to be clicked to reveal a popover. It
is needed by the date chooser, to have a combined month and year choice
that can be split in two via a popover.

This leaves the indendation purposefully broken to ease reviewing the
actual changes.
2022-06-16 08:23:45 -03:00
Adrien Plazas 78931df46c date-chooser: Add the split-month-year property
This allows unifying the month and year selectors into a single month
and year selector by setting it to false.
2022-06-16 08:23:44 -03:00
Adrien Plazas db0f07136c date-chooser: Implement GcalView
This also replace the date property by the overridden active-date one
ans adds the context property.
2022-06-16 08:22:45 -03:00
Adrien Plazas 6cb57b0ad5 date-chooser: Add the show-events property
This allows showing events from the timeline via a dot.
2022-06-16 08:19:49 -03:00
Adrien Plazas b5d8575445 date-chooser: Implement GcalTimelineSubscriber
This allows the date chooser to receive events from the timeline, and
will allow it to show them via a dot.
2022-06-16 08:19:47 -03:00