[gimp/gtk3-port: 127/227] app: port GimpContainerBox to GtkStyleContext



commit ebd12e7232f4d0f2ca50a87a2254de1887a5da8c
Author: Michael Natterer <mitch gimp org>
Date:   Sun Dec 19 14:23:16 2010 +0100

    app: port GimpContainerBox to GtkStyleContext

 app/widgets/gimpcontainerbox.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/app/widgets/gimpcontainerbox.c b/app/widgets/gimpcontainerbox.c
index 731c96d..13e2e30 100644
--- a/app/widgets/gimpcontainerbox.c
+++ b/app/widgets/gimpcontainerbox.c
@@ -132,9 +132,10 @@ gimp_container_box_set_size_request (GimpContainerBox *box,
 {
   GimpContainerView      *view;
   GtkScrolledWindowClass *sw_class;
-  GtkStyle               *sw_style;
+  GtkStyleContext        *sw_style;
   GtkWidget              *sb;
   GtkRequisition          req;
+  GtkBorder               border;
   gint                    view_size;
   gint                    scrollbar_width;
   gint                    border_x;
@@ -165,10 +166,12 @@ gimp_container_box_set_size_request (GimpContainerBox *box,
 
   border_x = border_y = gtk_container_get_border_width (GTK_CONTAINER (box));
 
-  sw_style = gtk_widget_get_style (box->scrolled_win);
+  sw_style = gtk_widget_get_style_context (box->scrolled_win);
 
-  border_x += sw_style->xthickness * 2 + scrollbar_width;
-  border_y += sw_style->ythickness * 2;
+  gtk_style_context_get_border (sw_style, 0, &border);
+
+  border_x += border.left + border.right + scrollbar_width;
+  border_y += border.top + border.bottom;
 
   gtk_widget_set_size_request (box->scrolled_win,
                                width  > 0 ? width  + border_x : -1,



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