[gimp/gtk3-port: 115/228] llibgimpwidgets: port GimpScrolledPreview to GtkStyleContext
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 115/228] llibgimpwidgets: port GimpScrolledPreview to GtkStyleContext
- Date: Mon, 14 Jan 2013 01:09:42 +0000 (UTC)
commit 372c16b3f0cc0c0650c4fa1e057e6122214073ef
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 33f0840..a86359d 100644
--- a/libgimpwidgets/gimpscrolledpreview.c
+++ b/libgimpwidgets/gimpscrolledpreview.c
@@ -561,13 +561,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);
@@ -621,9 +622,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]