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

This commit is contained in:
Michael Natterer 2010-10-17 10:38:32 +02:00
parent 04961e056d
commit 00b207a8d8
1 changed files with 13 additions and 14 deletions

View File

@ -53,8 +53,8 @@ static void gimp_stroke_editor_get_property (GObject *object,
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);
@ -193,8 +193,8 @@ gimp_stroke_editor_constructed (GObject *object)
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);
@ -209,8 +209,8 @@ gimp_stroke_editor_constructed (GObject *object)
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);
@ -325,9 +325,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;
@ -337,14 +337,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;
}