[gdl/gnome-3-0] [button image] port to GtkStyleContext



commit 5953ebe2242191aa780a9430fc616a3ad2e6c588
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed May 4 11:47:51 2011 +0200

    [button image] port to GtkStyleContext

 gdl/gdl-dock-item-button-image.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/gdl/gdl-dock-item-button-image.c b/gdl/gdl-dock-item-button-image.c
index 2468161..e242e28 100644
--- a/gdl/gdl-dock-item-button-image.c
+++ b/gdl/gdl-dock-item-button-image.c
@@ -35,8 +35,8 @@ gdl_dock_item_button_image_draw (GtkWidget      *widget,
                                  cairo_t *cr)
 {
     GdlDockItemButtonImage *button_image;
-    GtkStyle *style;
-    GdkColor *color;
+    GtkStyleContext *context;
+    GdkRGBA color;
     
     g_return_val_if_fail (widget != NULL, 0);
     button_image = GDL_DOCK_ITEM_BUTTON_IMAGE (widget);
@@ -44,11 +44,10 @@ gdl_dock_item_button_image_draw (GtkWidget      *widget,
     /* Set up the pen */
     cairo_set_line_width(cr, 1.0);
     
-    style = gtk_widget_get_style (widget);
-    g_return_val_if_fail (style != NULL, 0);
-    color = &style->fg[GTK_STATE_NORMAL];
-    cairo_set_source_rgba(cr, color->red / 65535.0,
-        color->green / 65535.0, color->blue / 65535.0, 0.55);
+    context = gtk_widget_get_style_context (widget);
+    gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
+    color.alpha = 0.55;
+    gdk_cairo_set_source_rgba(cr, &color);
 
     /* Draw the icon border */
     cairo_move_to (cr, 10.5, 2.5);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]