diff options
author | Bastien Nocera <hadess@hadess.net> | 2010-12-06 19:05:32 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2010-12-06 19:07:40 +0000 |
commit | dfb7c0a3dc7a9a2c1b769bd90bd74c03ad3faeeb (patch) | |
tree | edbaf5113ff43d271b765bcb5e005ebaaf3dbe18 /browser-plugin | |
parent | b64f844f751ced52ce3775374e6eaf342467fb5f (diff) |
browser: Port glow button to GtkStyleContext
Diffstat (limited to 'browser-plugin')
-rw-r--r-- | browser-plugin/totem-glow-button.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/browser-plugin/totem-glow-button.c b/browser-plugin/totem-glow-button.c index 76c5002d..d5a31f85 100644 --- a/browser-plugin/totem-glow-button.c +++ b/browser-plugin/totem-glow-button.c @@ -128,16 +128,19 @@ totem_glow_button_draw (GtkWidget *widget, gpointer user_data) { TotemGlowButton *button; - GtkStyle *style; + GtkStyleContext *context; GtkAllocation allocation, child_allocation; gint width, height; GtkWidget *child; + GdkRGBA acolor; button = TOTEM_GLOW_BUTTON (widget); if (button->glow_factor == 0.0) return FALSE; + context = gtk_widget_get_style_context (widget); + /* push a translucent overlay to paint to, so we can blend later */ cairo_push_group_with_content (cr, CAIRO_CONTENT_COLOR_ALPHA); @@ -147,11 +150,13 @@ totem_glow_button_draw (GtkWidget *widget, height = allocation.height; /* Draw a rectangle with bg[SELECTED] */ - style = gtk_widget_get_style (widget); - gdk_cairo_set_source_color (cr, &(style->bg[GTK_STATE_SELECTED])); - gtk_paint_box (style, cr, GTK_STATE_SELECTED, - GTK_SHADOW_OUT, widget, "button", - 0, 0, height, width); + gtk_style_context_save (context); + gtk_style_context_add_class (context, "button"); + gtk_style_context_set_state (context, GTK_STATE_SELECTED); + gtk_style_context_get_background_color (context, GTK_STATE_SELECTED, &acolor); + gdk_cairo_set_source_rgba (cr, &acolor); + gtk_render_background (context, cr, 0, 0, width, height); + gtk_style_context_restore (context); /* then the image */ cairo_save (cr); |