[gimp/gtk3-port: 55/215] app: port call to gtk_paint_arrow() to GTK+ 3.0



commit 89fa4eda4edb185d127e82453cbe476d3d2cac7d
Author: Michael Natterer <mitch gimp org>
Date:   Sun Oct 17 10:38:32 2010 +0200

    app: port call to gtk_paint_arrow() to GTK+ 3.0

 app/widgets/gimpstrokeeditor.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/app/widgets/gimpstrokeeditor.c b/app/widgets/gimpstrokeeditor.c
index e24b40b..4a34107 100644
--- a/app/widgets/gimpstrokeeditor.c
+++ b/app/widgets/gimpstrokeeditor.c
@@ -53,8 +53,8 @@ static void      gimp_stroke_editor_get_property (GObject           *object,
                                                   guint              property_id,
                                                   GValue            *value,
                                                   GParamSpec        *pspec);
-static gboolean  gimp_stroke_editor_paint_button (GtkWidget         *widget,
-                                                  GdkEventExpose    *event,
+static gboolean  gimp_stroke_editor_draw_button  (GtkWidget         *widget,
+                                                  cairo_t           *cr,
                                                   gpointer           data);
 static void      gimp_stroke_editor_dash_preset  (GtkWidget         *widget,
                                                   GimpStrokeOptions *options);
@@ -251,8 +251,8 @@ gimp_stroke_editor_constructor (GType                   type,
   g_signal_connect_object (button, "clicked",
                            G_CALLBACK (gimp_dash_editor_shift_left),
                            dash_editor, G_CONNECT_SWAPPED);
-  g_signal_connect_after (button, "expose-event",
-                          G_CALLBACK (gimp_stroke_editor_paint_button),
+  g_signal_connect_after (button, "draw",
+                          G_CALLBACK (gimp_stroke_editor_draw_button),
                           button);
 
   gtk_box_pack_start (GTK_BOX (box), dash_editor, TRUE, TRUE, 0);
@@ -267,8 +267,8 @@ gimp_stroke_editor_constructor (GType                   type,
   g_signal_connect_object (button, "clicked",
                            G_CALLBACK (gimp_dash_editor_shift_right),
                            dash_editor, G_CONNECT_SWAPPED);
-  g_signal_connect_after (button, "expose-event",
-                          G_CALLBACK (gimp_stroke_editor_paint_button),
+  g_signal_connect_after (button, "draw",
+                          G_CALLBACK (gimp_stroke_editor_draw_button),
                           NULL);
 
 
@@ -333,9 +333,9 @@ gimp_stroke_editor_new (GimpStrokeOptions *options,
 }
 
 static gboolean
-gimp_stroke_editor_paint_button (GtkWidget       *widget,
-                                 GdkEventExpose  *event,
-                                 gpointer         data)
+gimp_stroke_editor_draw_button (GtkWidget *widget,
+                                cairo_t   *cr,
+                                gpointer   data)
 {
   GtkStyle      *style = gtk_widget_get_style (widget);
   GtkAllocation  allocation;
@@ -345,14 +345,13 @@ gimp_stroke_editor_paint_button (GtkWidget       *widget,
 
   w = MIN (allocation.width, allocation.height) * 2 / 3;
 
-  gtk_paint_arrow (style,
-                   gtk_widget_get_window (widget),
+  gtk_paint_arrow (style, cr,
                    gtk_widget_get_state (widget),
                    GTK_SHADOW_IN,
-                   &event->area, widget, NULL,
+                   widget, NULL,
                    data ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, TRUE,
-                   allocation.x + (allocation.width - w) / 2,
-                   allocation.y + (allocation.height - w) / 2,
+                   (allocation.width  - w) / 2,
+                   (allocation.height - w) / 2,
                    w, w);
   return FALSE;
 }



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