views/week-view-common: Port from GtkStyleContext to GtkSnapshot

GtkStyleContext methods are deprecated.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/707>
This commit is contained in:
Hari Rana
2026-02-28 13:57:52 +00:00
committed by Marge Bot
parent 033e719833
commit bdfb4b609e
3 changed files with 4 additions and 15 deletions
-1
View File
@@ -105,7 +105,6 @@ gcal_week_hour_bar_init (GcalWeekHourBar *self)
{
GtkWidget *label = gtk_label_new ("");
gtk_widget_add_css_class (label, "line");
gtk_widget_add_css_class (label, "dimmed");
gtk_widget_set_vexpand (label, TRUE);
gtk_label_set_yalign (GTK_LABEL (label), 0.0);
+4 -6
View File
@@ -28,7 +28,6 @@ gcal_week_view_common_snapshot_hour_lines (GtkWidget *widget,
gint width,
gint height)
{
GtkStyleContext *context;
GdkRGBA color;
gboolean ltr;
gdouble column_width;
@@ -36,11 +35,10 @@ gcal_week_view_common_snapshot_hour_lines (GtkWidget *widget,
ltr = gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL;
context = gtk_widget_get_style_context (widget);
gtk_style_context_save (context);
gtk_style_context_add_class (context, "lines");
gtk_style_context_get_color (context, &color);
gtk_style_context_restore (context);
gtk_snapshot_save (snapshot);
gtk_widget_get_color (widget, &color);
color.alpha = 0.15;
gtk_snapshot_restore (snapshot);
column_width = width / 7.0;
-8
View File
@@ -221,19 +221,11 @@ label.month-name {
/* Week View CSS */
.week-header.lines {
color: rgb(from var(--window-fg-color) r g b / 15%);
}
weekhourbar > label {
font-size: 10pt;
padding: 4px 6px;
}
.week-view .lines {
color: rgb(from var(--window-fg-color) r g b / 15%);
}
.week-main-content {
border: 0 solid var(--border-color);
border-width: 1px 0;