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:
@@ -105,7 +105,6 @@ gcal_week_hour_bar_init (GcalWeekHourBar *self)
|
|||||||
{
|
{
|
||||||
GtkWidget *label = gtk_label_new ("");
|
GtkWidget *label = gtk_label_new ("");
|
||||||
|
|
||||||
gtk_widget_add_css_class (label, "line");
|
|
||||||
gtk_widget_add_css_class (label, "dimmed");
|
gtk_widget_add_css_class (label, "dimmed");
|
||||||
gtk_widget_set_vexpand (label, TRUE);
|
gtk_widget_set_vexpand (label, TRUE);
|
||||||
gtk_label_set_yalign (GTK_LABEL (label), 0.0);
|
gtk_label_set_yalign (GTK_LABEL (label), 0.0);
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ gcal_week_view_common_snapshot_hour_lines (GtkWidget *widget,
|
|||||||
gint width,
|
gint width,
|
||||||
gint height)
|
gint height)
|
||||||
{
|
{
|
||||||
GtkStyleContext *context;
|
|
||||||
GdkRGBA color;
|
GdkRGBA color;
|
||||||
gboolean ltr;
|
gboolean ltr;
|
||||||
gdouble column_width;
|
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;
|
ltr = gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL;
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
gtk_snapshot_save (snapshot);
|
||||||
gtk_style_context_save (context);
|
gtk_widget_get_color (widget, &color);
|
||||||
gtk_style_context_add_class (context, "lines");
|
color.alpha = 0.15;
|
||||||
gtk_style_context_get_color (context, &color);
|
gtk_snapshot_restore (snapshot);
|
||||||
gtk_style_context_restore (context);
|
|
||||||
|
|
||||||
column_width = width / 7.0;
|
column_width = width / 7.0;
|
||||||
|
|
||||||
|
|||||||
@@ -221,19 +221,11 @@ label.month-name {
|
|||||||
|
|
||||||
/* Week View CSS */
|
/* Week View CSS */
|
||||||
|
|
||||||
.week-header.lines {
|
|
||||||
color: rgb(from var(--window-fg-color) r g b / 15%);
|
|
||||||
}
|
|
||||||
|
|
||||||
weekhourbar > label {
|
weekhourbar > label {
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
padding: 4px 6px;
|
padding: 4px 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.week-view .lines {
|
|
||||||
color: rgb(from var(--window-fg-color) r g b / 15%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.week-main-content {
|
.week-main-content {
|
||||||
border: 0 solid var(--border-color);
|
border: 0 solid var(--border-color);
|
||||||
border-width: 1px 0;
|
border-width: 1px 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user