Files
federated-calendar/src/theme/events.css
T
Hari Rana f7c4f7b25a views/month-view-row: Calculate spacings in code
Visually, this comes with the benefit of not having the first
and last visible event widgets take additional margins, as spacing
is only applied between event widgets.

This will also allow us to make use of gtk_widget_pick() without
having to rely on hardcoding 1 on the y axis.

The current approach has a one pixel margin at the top and bottom
of each event widget, which offsets the vertical position of
every event widget by one pixel. In order to pick the first
event widget, we'd want to call
gcal_month_cell_get_header_height() because this is where the
first event widget is placed. If we were to invoke
gtk_widget_pick() with (x, 0), where x is
half the width of the month cell, the returned value would be
NULL because gtk_widget_pick() does not account for margins,
so it would need to be (x, 1), with 1 hardcoded.

Since this patch removes that offset, we can simply use
(x, 0) without having to hardcode 1.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/813>
2026-08-19 09:39:33 -04:00

56 lines
1.1 KiB
CSS

:root {
--event-border-radius: 6px;
}
event {
background-color: color-mix(in srgb, var(--event-bg-color) 25%, var(--view-bg-color));
border-radius: var(--event-border-radius);
color: var(--view-fg-color);
font-size: 0.9rem;
outline: 0 solid transparent;
outline-offset: 5px;
transition: var(--focus-ring-transition);
}
event:focus:focus-visible {
outline-color: rgb(from var(--accent-color) r g b / var(--dim-opacity));
outline-offset: 0;
outline-width: 2px;
}
event.slanted {
border-radius: 0 0 0 0;
}
event.slanted-start,
event.slanted-end:dir(rtl) {
border-radius: 0 var(--event-border-radius) var(--event-border-radius) 0;
}
event.slanted-end,
event.slanted-start:dir(rtl) {
border-radius: var(--event-border-radius) 0 0 var(--event-border-radius);
}
event widget.content {
margin: 4px;
}
event widget.edge {
background-color: var(--event-bg-color);
min-width: 6px;
}
event.slanted widget.edge,
event.slanted-start widget.edge {
background-color: transparent;
}
weekgrid event {
margin: 1px;
}
calendar-view.month-view event {
margin: 0 1px 0 1px;
}