From c03c5018882e79b23ce0961cc43950b8b4fb7393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20G=C3=B6llnitz?= Date: Thu, 13 Feb 2025 17:50:02 +0100 Subject: [PATCH] month-view: fix undershoot for new bottom bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/gui/views/gcal-month-view.c | 2 +- src/theme/style.css | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gui/views/gcal-month-view.c b/src/gui/views/gcal-month-view.c index 4cf60da5..0f440674 100644 --- a/src/gui/views/gcal-month-view.c +++ b/src/gui/views/gcal-month-view.c @@ -1477,7 +1477,7 @@ gcal_month_view_size_allocate (GtkWidget *widget, gtk_widget_measure (self->header, GTK_ORIENTATION_VERTICAL, width, &header_height, NULL, NULL, NULL); gtk_widget_allocate (self->header, width, header_height, baseline, NULL); - grid_height = height - header_height; + grid_height = height - header_height - 1; row_height = grid_height / (gdouble) N_ROWS_PER_PAGE; row_scroll_offset = self->row_offset * row_height; y_offset = header_height - row_scroll_offset - (grid_height * ((N_PAGES - 1) / 2.0)); diff --git a/src/theme/style.css b/src/theme/style.css index f6f6eeed..7a926ec4 100644 --- a/src/theme/style.css +++ b/src/theme/style.css @@ -295,14 +295,21 @@ monthcell:nth-child(7n + 1):dir(rtl) { */ calendar-view.scrolling > box { - background-color: transparent; box-shadow: var(--headerbar-shade-color) 0 2px 4px; - transition: box-shadow 200ms; } +calendar-view > box, calendar-view { + transition: box-shadow 200ms, background 200ms; +} -calendar-view:not(.scrolling) > box { - transition: box-shadow 200ms; +/* similar to https://gitlab.gnome.org/GNOME/libadwaita/-/blob/649967044e269a0118ae09a9ff0ecba90cc58300/src/stylesheet/_drawing.scss#L57 */ +calendar-view.scrolling { + box-shadow: inset 0px -1px color-mix(in srgb, var(--shade-color) 75%, transparent); + background: linear-gradient(to top, color-mix(in srgb, var(--shade-color) 75%, transparent), transparent 4px); +} + +.month-header { + padding-bottom: 6px; } /*