From 188d11125c64b2cc50045251ee03ddbfec08580e Mon Sep 17 00:00:00 2001 From: Skunnyk Date: Tue, 3 May 2016 16:04:31 +0200 Subject: [PATCH] Use cairo for drawing Need more works. --- panel-plugin/netload.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/panel-plugin/netload.c b/panel-plugin/netload.c index c0f888a..49dcdee 100644 --- a/panel-plugin/netload.c +++ b/panel-plugin/netload.c @@ -889,17 +889,12 @@ static void colorize_values_toggled(GtkWidget *check_button, t_global_monitor *g /* ---------------------------------------------------------------------------------------------- */ static gboolean expose_event_cb(GtkWidget *widget, GdkEventExpose *event) { - if (widget->window) + if (gtk_widget_get_window(widget)) { - GtkStyle *style; - - style = gtk_widget_get_style(widget); - - gdk_draw_rectangle(widget->window, - style->bg_gc[GTK_STATE_NORMAL], - TRUE, - event->area.x, event->area.y, - event->area.width, event->area.height); + cairo_t *cr; + cr = gdk_cairo_create (gtk_widget_get_window(widget)); + cairo_rectangle (cr, event->area.x, event->area.y, event->area.width, event->area.height); + cairo_fill (cr); } return TRUE;