[gimp/gtk3-port: 210/226] app: port GimpNavigationEditor to GtkStyleContext



commit c8a0b00377edfb1f9ecce9ccda869652cdaeca55
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 3 18:01:24 2011 +0200

    app: port GimpNavigationEditor to GtkStyleContext

 app/display/gimpnavigationeditor.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c
index 65f729e..887a3d2 100644
--- a/app/display/gimpnavigationeditor.c
+++ b/app/display/gimpnavigationeditor.c
@@ -230,7 +230,7 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
                               gint              click_x,
                               gint              click_y)
 {
-  GtkStyle             *style = gtk_widget_get_style (widget);
+  GtkStyleContext      *style = gtk_widget_get_style_context (widget);
   GimpNavigationEditor *editor;
   GimpNavigationView   *view;
   GdkScreen            *screen;
@@ -282,18 +282,22 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
                                          &view_marker_height);
   /* Position the popup */
   {
-    gint x_origin, y_origin;
-    gint popup_width, popup_height;
-    gint border_width, border_height;
-    gint screen_click_x, screen_click_y;
+    GtkBorder border;
+    gint      x_origin, y_origin;
+    gint      popup_width, popup_height;
+    gint      border_width, border_height;
+    gint      screen_click_x, screen_click_y;
 
     gdk_window_get_origin (gtk_widget_get_window (widget),
                            &x_origin, &y_origin);
 
+    gtk_style_context_get_border (style, gtk_widget_get_state_flags (widget),
+                                  &border);
+
     screen_click_x = x_origin + click_x;
     screen_click_y = y_origin + click_y;
-    border_width   = 2 * style->xthickness;
-    border_height  = 2 * style->ythickness;
+    border_width   = 2 * border.left;
+    border_height  = 2 * border.top;
     popup_width    = GIMP_VIEW (view)->renderer->width  - 2 * border_width;
     popup_height   = GIMP_VIEW (view)->renderer->height - 2 * border_height;
 


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