[gimp/gtk3-port: 132/237] modules: port ColorselWheel to GtkStyleContext



commit ac15ca1a9ceb1bbb4dfdf23bac4b70fb0d903127
Author: Michael Natterer <mitch gimp org>
Date:   Fri Dec 17 10:59:54 2010 +0100

    modules: port ColorselWheel to GtkStyleContext

 modules/color-selector-wheel.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/modules/color-selector-wheel.c b/modules/color-selector-wheel.c
index 465b095..b9f23ea 100644
--- a/modules/color-selector-wheel.c
+++ b/modules/color-selector-wheel.c
@@ -148,18 +148,22 @@ colorsel_wheel_size_allocate (GtkWidget     *frame,
                               GtkAllocation *allocation,
                               ColorselWheel *wheel)
 {
-  GtkStyle *style = gtk_widget_get_style (frame);
-  gint      focus_width;
-  gint      focus_padding;
-  gint      size;
+  GtkStyleContext *context = gtk_widget_get_style_context (frame);
+  GtkBorder        border;
+  gint             focus_width;
+  gint             focus_padding;
+  gint             size;
 
   gtk_widget_style_get (frame,
                         "focus-line-width", &focus_width,
                         "focus-padding",    &focus_padding,
                         NULL);
 
+  gtk_style_context_get_border (context, gtk_widget_get_state_flags (frame),
+                                &border);
+
   size = (MIN (allocation->width, allocation->height) -
-          2 * MAX (style->xthickness, style->ythickness) -
+          MAX (border.left + border.right, border.top + border.bottom) -
           2 * (focus_width + focus_padding));
 
   gtk_hsv_set_metrics (GTK_HSV (wheel->hsv), size, size / 10);



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