views/week: Cleanup line rendering code

Remove copied style context calls, pass less arguments.
This commit is contained in:
Georges Basile Stavracas Neto
2025-03-19 19:23:58 -03:00
parent 60c2bd2138
commit f9ad1c2e7e
5 changed files with 13 additions and 40 deletions
+1 -7
View File
@@ -1324,7 +1324,6 @@ gcal_week_header_snapshot (GtkWidget *widget,
GtkStyleContext *context;
GcalWeekHeader *self;
GtkStateFlags state;
GdkRGBA color;
int alloc_width;
int alloc_height;
GDateTime *week_start, *week_end;
@@ -1421,14 +1420,9 @@ gcal_week_header_snapshot (GtkWidget *widget,
width = gtk_widget_get_width (widget) - start_x;
height = gtk_widget_get_height (widget) - start_y;
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_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
gcal_week_view_common_snapshot_hour_lines (widget, snapshot, GTK_ORIENTATION_HORIZONTAL, &color, width, height);
gcal_week_view_common_snapshot_hour_lines (widget, snapshot, GTK_ORIENTATION_HORIZONTAL, width, height);
gtk_snapshot_restore (snapshot);
GTK_WIDGET_CLASS (gcal_week_header_parent_class)->snapshot (widget, snapshot);