summaryrefslogtreecommitdiff
path: root/libslab/app-resizer.c
diff options
context:
space:
mode:
authorzhuyaliang <[email protected]>2023-10-08 22:39:44 +0800
committerraveit65 <[email protected]>2023-10-11 15:27:35 +0200
commitb4205246abe19ce52c11c326dd83b1dcda01d2bd (patch)
tree1db0277b0194341566a3da621a02f388c0baf9c0 /libslab/app-resizer.c
parent9df51ef52b7c6e29dd02a1c44d488074893d0c28 (diff)
downloadmate-control-center-b4205246abe19ce52c11c326dd83b1dcda01d2bd.tar.bz2
mate-control-center-b4205246abe19ce52c11c326dd83b1dcda01d2bd.tar.xz
libslab: Fix compilation warnings and replace deprecated functions
Diffstat (limited to 'libslab/app-resizer.c')
-rw-r--r--libslab/app-resizer.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/libslab/app-resizer.c b/libslab/app-resizer.c
index f7d9d0a1..0e1a15b8 100644
--- a/libslab/app-resizer.c
+++ b/libslab/app-resizer.c
@@ -275,11 +275,19 @@ static gboolean
app_resizer_paint_window (GtkWidget * widget, cairo_t * cr, AppShellData * app_data)
{
cairo_save(cr);
+ GtkStyleContext *context;
+ GdkRGBA *bg_rgba = NULL;
GtkAllocation widget_allocation;
gtk_widget_get_allocation (widget, &widget_allocation);
- gdk_cairo_set_source_color (cr, gtk_widget_get_style (widget)->base);
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_get (context,
+ GTK_STATE_FLAG_NORMAL,
+ "background-color", &bg_rgba,
+ NULL);
+
+ gdk_cairo_set_source_rgba (cr, bg_rgba);
cairo_set_line_width(cr, 1);
cairo_rectangle(cr, widget_allocation.x, widget_allocation.y, widget_allocation.width, widget_allocation.height);
@@ -289,19 +297,25 @@ app_resizer_paint_window (GtkWidget * widget, cairo_t * cr, AppShellData * app_d
if (app_data->selected_group)
{
GtkWidget *selected_widget = GTK_WIDGET (app_data->selected_group);
+ GdkRGBA *rgba;
GtkAllocation selected_widget_allocation;
-
gtk_widget_get_allocation (selected_widget, &selected_widget_allocation);
- gdk_cairo_set_source_color (cr, gtk_widget_get_style (selected_widget)->light);
- cairo_set_line_width(cr, 1);
+ gtk_style_context_get (context,
+ GTK_STATE_FLAG_PRELIGHT,
+ "background-color", &rgba,
+ NULL);
+ gdk_cairo_set_source_rgba (cr, rgba);
+ cairo_set_line_width(cr, 1);
cairo_rectangle(cr, selected_widget_allocation.x, selected_widget_allocation.y, selected_widget_allocation.width, selected_widget_allocation.height);
cairo_stroke_preserve(cr);
cairo_fill(cr);
+ gdk_rgba_free (rgba);
}
cairo_restore(cr);
+ gdk_rgba_free (bg_rgba);
return FALSE;
}