[gimp/gtk3-port: 141/457] app: port GimpOverlayFrame to GtkStyleContext



commit 6b926299502ad08c3727e6bf628ccae2f43a9b74
Author: Michael Natterer <mitch gimp org>
Date:   Wed Dec 29 15:53:15 2010 +0100

    app: port GimpOverlayFrame to GtkStyleContext

 app/widgets/gimpoverlayframe.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/app/widgets/gimpoverlayframe.c b/app/widgets/gimpoverlayframe.c
index adfec7f..67a8e47 100644
--- a/app/widgets/gimpoverlayframe.c
+++ b/app/widgets/gimpoverlayframe.c
@@ -132,10 +132,11 @@ static gboolean
 gimp_overlay_frame_draw (GtkWidget *widget,
                          cairo_t   *cr)
 {
-  GtkStyle      *style = gtk_widget_get_style (widget);
-  GtkAllocation  allocation;
-  gboolean       rgba;
-  gint           border_width;
+  GtkStyleContext *style = gtk_widget_get_style_context (widget);
+  GtkAllocation    allocation;
+  GdkRGBA          color;
+  gboolean         rgba;
+  gint             border_width;
 
   rgba = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)) != NULL;
 
@@ -163,13 +164,19 @@ gimp_overlay_frame_draw (GtkWidget *widget,
 
   cairo_clip_preserve (cr);
 
-  gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
+  gtk_style_context_get_background_color (style,
+                                          gtk_widget_get_state_flags (widget),
+                                          &color);
+  gdk_cairo_set_source_rgba (cr, &color);
   cairo_paint (cr);
 
   if (border_width > 0)
     {
       cairo_set_line_width (cr, 2.0);
-      gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
+      gtk_style_context_get_color (style,
+                                   gtk_widget_get_state_flags (widget),
+                                   &color);
+      gdk_cairo_set_source_rgba (cr, &color);
       cairo_stroke (cr);
     }
 


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