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>
This commit is contained in:
Hari Rana
2025-07-08 14:08:37 +00:00
committed by Marge Bot
parent a0b530298a
commit 684ed71711
3 changed files with 19 additions and 13 deletions
+4
View File
@@ -3,6 +3,10 @@ using Gtk 4.0;
template $GcalMonthView: Widget { template $GcalMonthView: Widget {
overflow: hidden; overflow: hidden;
styles [
"month-view",
]
EventControllerScroll { EventControllerScroll {
flags: vertical | kinetic; flags: vertical | kinetic;
scroll-begin => $on_scroll_controller_scroll_begin_cb(template) not-swapped; scroll-begin => $on_scroll_controller_scroll_begin_cb(template) not-swapped;
+4
View File
@@ -4,3 +4,7 @@ datechooser .weeknum {
border: 1px solid rgb(from currentColor r g b / 50%); border: 1px solid rgb(from currentColor r g b / 50%);
} }
calendar-view.month-view {
--raised-shade-color: var(--border-color);
--raised-shade-color-base: transparent;
}
+11 -13
View File
@@ -315,22 +315,20 @@ monthcell.separator-top.separator-side {
* Month row * Month row
*/ */
calendar-view.scrolling > box { calendar-view.month-view {
box-shadow: var(--headerbar-shade-color) 0 2px 4px; --raised-shade-color-base:
color-mix(in srgb, var(--headerbar-shade-color) 50%, transparent);
box-shadow:
inset 0 -1px var(--raised-shade-color, var(--raised-shade-color-base)),
inset 0 -2px 4px var(--raised-shade-color-base);
} }
calendar-view > box, calendar-view { calendar-view.month-view > box.month-header {
transition: box-shadow 200ms, background 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; padding-bottom: 6px;
box-shadow:
0 1px var(--raised-shade-color, var(--raised-shade-color-base)),
0 2px 4px var(--raised-shade-color-base);
} }
/* /*