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



commit 37926630d2e385d2b12898ea4f9b4d9c4c8531d8
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]