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>
This commit is contained in:
Hari Rana
2025-08-18 19:59:43 -04:00
parent f887ea10f8
commit 534fb3a83c
3 changed files with 6 additions and 34 deletions
+3 -2
View File
@@ -182,7 +182,7 @@ update_header_func (GtkListBoxRow *row,
{ {
header = g_object_new (GTK_TYPE_LABEL, header = g_object_new (GTK_TYPE_LABEL,
"label", e_source_get_display_name (parent), "label", e_source_get_display_name (parent),
"css-classes", (const gchar * const []) { "header", NULL }, "css-classes", (const gchar * const []) { "heading", "dimmed", NULL },
"xalign", 0.0, "xalign", 0.0,
"margin-top", 18, "margin-top", 18,
"margin-bottom", 6, "margin-bottom", 6,
@@ -195,7 +195,7 @@ update_header_func (GtkListBoxRow *row,
{ {
header = g_object_new (GTK_TYPE_LABEL, header = g_object_new (GTK_TYPE_LABEL,
"label", e_source_get_display_name (parent), "label", e_source_get_display_name (parent),
"css-classes", (const gchar * const []) { "header", NULL }, "css-classes", (const gchar * const []) { "heading", "dimmed", NULL },
"xalign", 0.0, "xalign", 0.0,
"margin-top", 18, "margin-top", 18,
"margin-bottom", 6, "margin-bottom", 6,
@@ -311,3 +311,4 @@ gcal_calendar_list_init (GcalCalendarList *self)
{ {
gtk_widget_init_template (GTK_WIDGET (self)); gtk_widget_init_template (GTK_WIDGET (self));
} }
+2 -28
View File
@@ -34,6 +34,8 @@ template $GcalMonthView: Widget {
[header] [header]
Box { Box {
styles [ styles [
"header",
"heading",
"month-header", "month-header",
"view", "view",
] ]
@@ -44,70 +46,42 @@ template $GcalMonthView: Widget {
margin-start: 6; margin-start: 6;
hexpand: true; hexpand: true;
xalign: 0.0; xalign: 0.0;
styles [
"header",
]
} }
Label label_1 { Label label_1 {
margin-start: 6; margin-start: 6;
hexpand: true; hexpand: true;
xalign: 0.0; xalign: 0.0;
styles [
"header",
]
} }
Label label_2 { Label label_2 {
margin-start: 6; margin-start: 6;
hexpand: true; hexpand: true;
xalign: 0.0; xalign: 0.0;
styles [
"header",
]
} }
Label label_3 { Label label_3 {
margin-start: 6; margin-start: 6;
hexpand: true; hexpand: true;
xalign: 0.0; xalign: 0.0;
styles [
"header",
]
} }
Label label_4 { Label label_4 {
margin-start: 6; margin-start: 6;
hexpand: true; hexpand: true;
xalign: 0.0; xalign: 0.0;
styles [
"header",
]
} }
Label label_5 { Label label_5 {
margin-start: 6; margin-start: 6;
hexpand: true; hexpand: true;
xalign: 0.0; xalign: 0.0;
styles [
"header",
]
} }
Label label_6 { Label label_6 {
margin-start: 6; margin-start: 6;
hexpand: true; hexpand: true;
xalign: 0.0; xalign: 0.0;
styles [
"header",
]
} }
} }
} }
+1 -4
View File
@@ -15,10 +15,7 @@ calendar-view {
font-size: 10pt; font-size: 10pt;
} }
calendar-view.header, calendar-view box.header label {
label.header {
font-size: 10pt;
font-weight: bold;
opacity: var(--dim-opacity); opacity: var(--dim-opacity);
} }