Commit Graph
154 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto a07d80cccf views/week: Extract headers into GcalWeekView
Instead of handling them in GcalWeekHeader
2025-04-04 21:00:29 -03:00
Georges Basile Stavracas Neto 65f793b59e views/week: Use widget for DnD 2025-04-04 21:00:29 -03:00
Georges Basile Stavracas Neto f4ef9a29c3 views/week: Use anonymous struct for DnD 2025-04-04 21:00:29 -03:00
Georges Basile Stavracas Neto cbfada052d views/week: Use widget to draw selection
Same as week grid.
2025-04-04 21:00:29 -03:00
Georges Basile Stavracas Neto e94600668c weeks/view: Add anonymous struct for selection
Same as the grid view.
2025-04-04 21:00:29 -03:00
Georges Basile Stavracas Neto ea23581cf5 views/week: Use g_autoptr more
And remove an unused variable.
2025-04-04 21:00:29 -03:00
Georges Basile Stavracas Neto 82fa42ec9e views/week: Replace chain up by manual snapshotting
Should make it easier to spot mistakes in the future.
2025-04-04 21:00:29 -03:00
Georges Basile Stavracas Neto fb52dae400 views/week: Turn GcalWeekHeader into a GtkWidget
No functional changes so far.
2025-04-04 21:00:29 -03:00
Georges Basile Stavracas Neto 7c8285bdab views/week: Add intermediary GtkBox 2025-04-04 21:00:28 -03:00
Georges Basile Stavracas Neto ed3e06dd0e views/week: Cleanup measurement code
It's lame but simply removing the code works.
2025-03-19 19:23:58 -03:00
Georges Basile Stavracas Neto f9ad1c2e7e views/week: Cleanup line rendering code
Remove copied style context calls, pass less arguments.
2025-03-19 19:23:58 -03:00
Georges Basile Stavracas Neto 60c2bd2138 views/week: Make selection widget permanent
And toggle its visibility instead, like the DnD widget.
2025-03-19 19:23:57 -03:00
Georges Basile Stavracas Neto 81e881caa9 views/week: Use widget for drop target indicator
Gets rid of a few warnings
2025-03-19 19:23:57 -03:00
Georges Basile Stavracas Neto fad962c6ed views/week: Cosmetics 2025-03-19 19:23:57 -03:00
Georges Basile Stavracas Neto 280515a1b5 views/week: Simplify return statement
dnd.cell is never -1 in this code path.
2025-03-19 19:23:57 -03:00
Georges Basile Stavracas Neto 5d60bfc797 views/week: Use anonymous struct for dnd
No functional changes.
2025-03-19 19:23:57 -03:00
Georges Basile Stavracas Neto 69ac7468e2 views/week: Replace selection rendering with widget
Should get rid of a few warnings. No functional changes.
2025-03-19 19:23:57 -03:00
Georges Basile Stavracas Neto d7a6d95629 views/week: Use anonymous strict for selection
No functional changes.
2025-03-19 19:23:57 -03:00
Georges Basile Stavracas Neto bebfe587e1 views/month: Add missing GCAL_EXIT 2025-03-11 17:52:15 -03:00
Georges Basile Stavracas Neto de342e5606 gui/event-widget: Properly handle read-only events
Handle it internally, as it should be.
2025-03-11 17:52:14 -03:00
Georges Basile Stavracas Neto 03e6e39433 views/month: Rebuild layout blocks at once per frame
Instead of rebuilding them all every time an event is added or removed,
rebuild it once per frame. In case the month view isn't visible, don't
do anything, and wait until it's mapped to actually rebuild the event
blocks.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1381
Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1125
2025-03-11 17:52:14 -03:00
Georges Basile Stavracas Neto 67a6d0a002 views/month: Cosmetics 2025-03-11 15:22:51 -03:00
Brage Fuglseth 9007534114 i18n: Fix date format explanations for translators
The comments explaining date formatting to translators have a couple of typos related to the day name variables (%A and %a).

This commit fixes them.

Closes #1377
2025-03-01 13:30:45 +00:00
Titouan Real 0097ab9794 Mark date formats as translatable
Fix #1204
2025-02-06 16:49:10 +01:00
Georges Basile Stavracas Neto 905a813f58 views/week: Protect against 0-height scrollview
Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1352
2025-01-31 19:38:27 -03:00
Georges Basile Stavracas Neto 47fd758d01 views/month: Override dispose, not finalize 2025-01-22 16:45:39 -03:00
Markus Göllnitz 44894475d0 views/month: Display only weather icon under space contraint
If the horizontal space does not allow for an icon and
a temperature label, there'd still be enough space for
an icon only.

Visually, it makes sense to align that icon in icon-only
mode to the end.

Closes: #856

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Co-authored-by: Georged Basile Stavracas Neto
<georges.stavracas@gmail.com>
2025-01-22 16:45:31 -03:00
Markus Göllnitz 87607efa90 views/month: Fix measurement of month view and month rows
The measurement in opposit direction of the one in which
the elements are lined up needs not to add up all the
sizes but just get the maximal size.

This bug leads to too high minimal and natural widths
(and heights) of the month view.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2025-01-22 16:45:23 -03:00
Hari Rana 4fb3a69313 month-popover: Add Escape trigger action 2024-12-16 18:14:11 -03:00
Hari Rana 8c8bea1cf0 month-popover: Add "popdown" action 2024-12-16 18:11:59 -03:00
Hari Rana 415903f584 month-popover: Grab focus to New Event button at popup 2024-12-16 18:07:04 -03:00
Abdullahi Usman b44c712a3a agenda-view: Sort events in chronological order
agenda-view sort_func uses gcal_date_time_compare_date, which is
insufficient for this case.
we want to compare events date(s) down to the last minute, so that we
can be able to sort them in chronological order.
we use the g_date_time_compare function.

Fixes: #936

Co-authored-by: Georges Basile Stavracas Neto
<georges.stavracas@gmail.com>
2024-11-06 10:53:09 -03:00
Austin Pringle 11db394643 gcal-week-header: Change week header capitalization on week number heading. 2024-10-22 11:48:15 +00:00
Otávio Silva b25623071f view: Fix drag and drop issue with events in daylight saving time
When dragging and dropping events in week view during the week of
daylight savings time switch, events were off by one hour. This fixes this
behavior by using the util function gcal_date_time_add_floating_minutes.

Fixes #1198
2024-08-28 00:20:18 +00:00
Georges Basile Stavracas Neto 5f86b88c3b views/month: Increase overflow popover min width
Makes it so that it's at least 1.25 the width of a day cell, and at
most 1.5 of that.

Closes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1166
2024-08-13 16:25:45 +00:00
Georges Basile Stavracas Neto 2b85b9c680 views/month: Rename a variable
Makes it clearer that this is the day cell.
2024-08-13 16:25:45 +00:00
Georges Basile Stavracas Neto 54657788d0 views/month: Use variables some more
Makes it easier to reason about the if conditions there.
2024-08-13 16:25:45 +00:00
Philipp S a0ec0cde36 views/month: Distribute week day header labels homogeneously. 2024-07-26 22:09:02 +00:00
Daniel Garcia Moreno d7bbda4eaa views/agenda: Do not create new header for all-day
Fix https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/898
Fix https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/968
2024-07-09 19:59:42 +00:00
Hari Rana a3ac698e60 month-cell: Add month separators 2024-01-27 16:14:17 +00:00
Markus Göllnitz 74b1296d07 month-cell: hold weather service while this widget exists
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2024-01-27 16:09:02 +00:00
Rami Alkawadri c06e45f595 month-view: Make the selection range type date only 2024-01-15 19:31:56 +00:00
Felipe Kinoshita be73ecf175 gcal-week-header: Stop using gtk_widget_get_allocation
gtk_widget_get_allocation is deprecated, let's use
gtk_widget_get_width/gtk_widget_get_height instead.
2023-12-05 21:09:23 +00:00
Felipe Kinoshita c7d2854986 gcal-week-grid: Stop using gtk_widget_get_allocation
gtk_widget_get_allocation is deprecated, let's use
gtk_widget_get_width/gtk_widget_get_height instead.
2023-11-29 07:08:14 -03: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
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 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 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