[gimp/gtk3-port: 139/243] llibgimpwidgets: port GimpScrolledPreview to GtkStyleContext



commit 05fb766b23ccd65d16055a9a1e54f182bb9056a1
Author: Michael Natterer <mitch gimp org>
Date:   Fri Dec 17 00:03:40 2010 +0100

    llibgimpwidgets: port GimpScrolledPreview to GtkStyleContext

 libgimpwidgets/gimpscrolledpreview.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/libgimpwidgets/gimpscrolledpreview.c b/libgimpwidgets/gimpscrolledpreview.c
index 55fa820..596c8f4 100644
--- a/libgimpwidgets/gimpscrolledpreview.c
+++ b/libgimpwidgets/gimpscrolledpreview.c
@@ -558,13 +558,14 @@ gimp_scrolled_preview_nav_button_press (GtkWidget           *widget,
 
   if (event->type == GDK_BUTTON_PRESS && event->button == 1)
     {
-      GtkStyle   *style = gtk_widget_get_style (widget);
-      GtkWidget  *outer;
-      GtkWidget  *inner;
-      GtkWidget  *area;
-      GdkCursor  *cursor;
-      gint        x, y;
-      gdouble     h, v;
+      GtkStyleContext *context = gtk_widget_get_style_context (widget);
+      GtkWidget       *outer;
+      GtkWidget       *inner;
+      GtkWidget       *area;
+      GdkCursor       *cursor;
+      GtkBorder        border;
+      gint             x, y;
+      gdouble          h, v;
 
       preview->nav_popup = gtk_window_new (GTK_WINDOW_POPUP);
 
@@ -618,9 +619,11 @@ gimp_scrolled_preview_nav_button_press (GtkWidget           *widget,
       x += event->x - h * (gdouble) GIMP_PREVIEW_AREA (area)->width;
       y += event->y - v * (gdouble) GIMP_PREVIEW_AREA (area)->height;
 
+      gtk_style_context_get_border (context, 0, &border);
+
       gtk_window_move (GTK_WINDOW (preview->nav_popup),
-                       x - 2 * style->xthickness,
-                       y - 2 * style->ythickness);
+                       x - (border.left + border.right),
+                       y - (border.top + border.bottom));
 
       gtk_widget_show (preview->nav_popup);
 



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