Commit Graph
217 Commits
Author SHA1 Message Date
Hari Rana 6d47fc1db8 views/month-view-row: Add offset when allocating event widgets
The SEPARATOR_OFFSET constant is for the box shadow property
defined in month cells' CSS. Since the box-shadow property does
not contribute to layout, so these offsets need to be set manually.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/676>
2025-12-28 17:04:32 +00:00
Hari Rana b0a5ff18d5 views/month-view-row: Compute exact width of event widgets
Currently, month cells are using `round()` to allocate the width,
whereas event widgets are using implicit double → int conversion,
which causes event widgets to be offset by a pixel, and thus
touches month cells' borders.

This new approach guarantees the exact width of the event widgets
by invoking `round()`.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/676>
2025-12-28 17:04:32 +00:00
Adrien Plazas 9c1a7fecfc week-header: Fix end of week comparison
This fixes comparison of an event to the end of the week, so "end" can't
incorrectly be 7 anymore.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/835

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/672>
2025-12-03 20:50:15 +01:00
Hari Rana 82198e0b8f views/month-view: Smoothen discrete scrolling animation
The current animation duration paired with the ease-out-quad function
eases out imperceptibly fast (almost instantaneously), which makes the
overall animation feel laggy.

This patch addresses the aforementioned issue by increasing the
duration to 500ms. This then makes the ease-out-quad function ease
out relatively slowly, which is addressed by changing the function
to ease-out-quart - a function that eases out much quicker.

As a result, the animation should feel much more fluid and natural,
without giving the impression that it's 3 times slower.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1125
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/670>
2025-11-29 08:59:50 -05:00
Hari Rana 0a8bd0e994 views/month-view: Use ease-out-sine when snapping to row
It should feel a little bit more natural as it is eases out slower.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/670>
2025-11-29 08:59:33 -05:00
Hari Rana bf86699f84 views/month-view: Check for user's reduced motion setting
"gtk-interface-reduced-motion" is the modern alternative to
"gtk-enable-animations" but gtk-enable-animations will be
kept as as a fallback.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/670>
2025-11-29 08:47:20 -05:00
Hari Rana f4702dde1f views/month-view: Remove offset
Since we're now relying on box shadows to render separators,
which don't contribute to layout, we no longer need to set some
sort of offset to compensate the separators.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/669>
2025-11-27 11:52:31 +00:00
Georges Basile Stavracas Neto 564ce76349 views/month: Don't manually set can-focus property
Now that we're meddling with child visibility, hidden rows shouldn't
be focusable. At least that's what Hari discovered :)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/659>
2025-11-08 22:02:49 -03:00
Georges Basile Stavracas Neto 084a495f5c views/month: Hide invisible rows
Change the child-visible property of rows when allocating. It's safe
to do in allocation because it doesn't affect layout, just rendering.

Related:
https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/402

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/659>
2025-11-08 21:18:55 -03:00
Philipp Sauberzweig ef4c70fa4c month-cell: Add pill style to first day of the month.
Add a pill style to the label of the first day of the month to make it easy to identify. Adjust the border radius of the existing pill style for the current date to be the same. Apply the font-weight using the new style class.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/647>
2025-10-28 14:06:44 +00:00
Philipp Sauberzweig 6e97c05a14 views: Merge month name and date number into a single label.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/647>
2025-10-28 14:06:44 +00:00
Philipp Sauberzweig a32df2b070 views/month-cell: Remove dimming of out-of-month cells
The infinite scrolling month view obsoletes the out-of-month
dimming, as the view is no longer fixed in a specific month, nor
does it make out-of-month cells insensitive.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1145
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/646>
2025-10-17 18:06:17 -04:00
Lukáš Tyrychtr 3a544b22fc week-view: Add tooltip to the all day events expander
This adds a tooltip to the all day events expander button,
indicating whether the expander will expand or collapse
upon activation.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1449

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/637>
2025-10-17 13:59:26 -04:00
Hari Rana 3a93a4004d views/month-popover: Use adw_lerp() function
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/650>
2025-10-17 17:08:42 +00:00
Philipp Sauberzweig fc90d259b2 gui/views: Fix event margins in week header
Margins are already applied to the event widget itself through CSS.
This commit removes unnecessary margins and row spacing to bring
it in line with the month view.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/649>
2025-10-17 12:27:03 -04:00
Trystan Mata 0b25305aa4 view/month-view: Fix seeking ancestor of NULL
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/638>
2025-09-04 15:29:01 +00:00
Hari Rana 1ab336009e views/month-view: Skip view when tabbing in event widget
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1444
2025-08-25 21:33:58 -06:00
Hari Rana 534fb3a83c gui: Update to libadwaita's custom properties and style classes
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1440

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/624>
2025-08-18 19:59:43 -04:00
Hari Rana be0ba51481 gui: Replace dim-label with dimmed style class
`dim-label` is deprecated.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/624>
2025-08-18 18:37:25 -04:00
Jean-François Fortin Tam e56ef92abd gcal-month-cell: Fix a typo in a comment 2025-08-18 15:16:35 -04:00
Jean-François Fortin Tam e2a3d31532 month-cell: Use full-length month names when safe to do so
Full month names are easier to notice and read while scrolling,
and would be read more naturally by text-to-speech screen readers.

An exception must be made when today is near the beginning of the month,
as the weather forecast temperatures labels might also appear there.
In that case, use the abbreviated version of the month name label.

Fixes issue #962
2025-08-18 15:16:35 -04:00
Emma Blink fbc181743b week-view: explicitly handle PgUp/PgDown via ShortcutController
ScrolledWindow handles PgUp/PgDown in bubble phase to trigger scrolling.
Which leads to inconsistent behaviour: scrolling when an event is focused,
and moving to the previous/next week when not. Explicitly handling the
shortcuts with a ShortcutController in capture phase makes it consistently
navigate to previous/next week.

Fixes #1409

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/618>
2025-07-27 16:23:40 +01:00
Jean-François Fortin Tam 1ab28d3e95 month-cell: Bold month name & 1st day labels
Make it easier to track which month you are crossing while scrolling.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/962
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/478>
2025-07-15 15:46:41 -04:00
Jean-François Fortin Tam 1b500973e6 month-cell: Simplify calls to day_of_month
We already had this local variable waiting to be used;
let's reuse it to avoid calling querying the date repeatedly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/478>
2025-07-15 15:46:41 -04:00
Georges Basile Stavracas Neto 7282943d21 views/month: Remove useless function
The update_header_labels() was rendered useless after commit 1de447f7.

This was discovered by static-scan. Thanks for Arak for finding the
root cause.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1418
2025-07-11 13:33:13 -03:00
Hari Rana 684ed71711 css: Rework month view's box shadows
This makes the box shadows permanent.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/604>
2025-07-08 14:08:37 +00:00
Hari Rana a0b530298a views/month-view: Allocate more for grid height
This allocates two extra pixels for the grid's height to make
the cell borders hide below the footer.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/604>
2025-07-08 14:08:37 +00:00
Hari Rana 110856ee1a views/month-cell: Don't assert icon_tooltip_binding
The g_assert line would exit the program whenever we tried targeting
a month cell from the inspector.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/601>
2025-07-05 18:06:05 -04:00
Hari Rana 8dd8538014 views/month-cell: Use GtkWidget APIs for retrieving margin
GtkStyleContext is deprecated.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/601>
2025-07-05 18:05:07 -04:00
Hari Rana b368e1f674 views/agenda-view: Set accessible properties for list items
This is needed to have the screen reader read event information
out loud.

Related: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1036
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/606>
2025-06-30 16:18:06 +00:00
Clockwork-CritterandHari Rana 951062340f views/gcal-view: Appropriately denote properties
Co-authored-by: Hari Rana <theevilskeleton@riseup.net>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/600>
2025-06-22 08:50:19 -04:00
Clockwork-CritterandHari Rana 90556c3881 views/gcal-view: Correct GcalView:context docs
The `GcalView:context` documentation denotes the incorrect information.

Co-authored-by: Hari Rana <theevilskeleton@riseup.net>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/600>
2025-06-22 08:49:59 -04:00
Markus Göllnitz 05eb46511f week-view: add border around scrolled main area for distiction from toolbar
Currently, at the top there is an always visible border
which, due to having the same colour as the drop shadow,
slightly interferes with how the drop shadow looks, while
more severely, the bottom bar's start is not easily
distinguishable from the week grid's end, as there is
no border at all.

Styling the scrolled content itself with a border
elegantly solves these two issues, because now a drop
shadow is drawn when scrolling in a direction is
possible, and a border is drawn otherwise.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1406

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/593>
2025-06-11 06:14:13 +02:00
Jamie Gravendeel a509de8b1e gui: Port to Blueprint
This was mostly done with `blueprint-compiler port`.

Since Blueprint doesn't know about custom templates, I had to manually change some values from strings to literals.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/567>
2025-06-08 14:31:01 +02:00
Markus Göllnitz c03c501888 month-view: fix undershoot for new bottom bar
This adds the same styling as .undershoot-bottom would
while scrolling and adjusts the size allocation of month
rows, so that the top border of the month row right below
the last one is already visible.

Link: https://gitlab.gnome.org/GNOME/libadwaita/-/blob/649967044e269a0118ae09a9ff0ecba90cc58300/src/stylesheet/_drawing.scss#L57

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/542>
2025-06-08 09:59:00 +00:00
Markus Göllnitz 4a4dce8ee3 views: add time direction property
The time direction property tells which orientation one
needs to scroll to change the time of the view. In these
directions (up/down v left/right) the new prev/next
buttons will be pointing.

The two buttons will be added in a subsequent commit,
and will gain view-dependent tooltips.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/542>
2025-06-08 09:59:00 +00:00
Markus Göllnitz d400048bc6 week-view: remove week, month, and year header
This provides only little benefit over the new navigation
button's label. Thus, it is not there in the here newly
implemented UI mock-ups.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/542>
2025-06-08 09:59:00 +00:00
Markus Göllnitz 1de447f7f3 month-view: remove month and year header
This header duplicates the month and year from the new
navigation button in the header.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/542>
2025-06-08 09:59:00 +00:00
Markus Göllnitz dec31cadd4 views: move agenda view to main area
This prepares for multiple views to be there for mobile
users, and is the location at which a dedicated agenda
view for desktop will be, once the current agenda view
is refactored to suit desktop use-cases better.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/542>
2025-06-08 09:59:00 +00:00
Philipp S 74c17a7126 views/week: Align hour bar labels at the top
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/572>
2025-05-30 14:28:39 +00:00
Federico Mena Quintero 2eec02b76a gui/views/month-view: Initialize two variables
The static analizer can't figure out that they will always be initialized
by the for loop in this function.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/581>
2025-05-28 18:08:54 +00:00
Federico Mena Quintero a3ddd8e510 gui/views/month-view: Mark variable as unused
It's just a temporary reference that will get removed at function exit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/581>
2025-05-28 18:08:54 +00:00
Federico Mena Quintero 172f07c44e gui/views/week-grid: Remove superfluous assignment
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/581>
2025-05-28 18:08:54 +00:00
Federico Mena Quintero e56ce53ea5 gui/views/week-header: Remove superfluous assignment
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/581>
2025-05-28 18:08:54 +00:00
Federico Mena Quintero 81c8900076 gui/views/week-header: Remove unused variable
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/581>
2025-05-28 18:08:54 +00:00
Federico Mena Quintero bc53f169eb gui/views/week-header: Remove unused variable
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/581>
2025-05-28 18:08:54 +00:00
Hari Rana 6cd138974f views/week-header: Port to gtk_widget_compute_point
`gtk_widget_translate_coordinates` is deprecated.
2025-05-21 01:21:38 -03:00
Hari Rana 2bfa881c2d views/week-grid: Port to gtk_widget_compute_point
`gtk_widget_translate_coordinates` is deprecated.
2025-05-21 01:21:38 -03:00
Hari Rana a25b129643 views/month: Disallow moving focus out of the view with arrow keys 2025-05-21 01:17:33 -03:00
Hari Rana ed1db0bf72 views/month: Move out of the view when pressing tab
This makes it so the user can easily skip the entire month view
by pressing tab within the month view. This means, events can only
be accessed with arrow keys in the month view.
2025-05-21 01:14:17 -03:00