From 27179d62197eb71744c0610036ce13d873a8a1e3 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 21 Jan 2011 18:18:44 +0100 Subject: [PATCH] app: don't duplicate code when setting GimpSpinScale's cursor --- app/widgets/gimpspinscale.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/app/widgets/gimpspinscale.c b/app/widgets/gimpspinscale.c index b88b3313c0..d1b1368da6 100644 --- a/app/widgets/gimpspinscale.c +++ b/app/widgets/gimpspinscale.c @@ -383,24 +383,16 @@ gimp_spin_scale_button_motion (GtkWidget *widget, (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) && event->window == gtk_entry_get_text_window (GTK_ENTRY (widget))) { + GdkDisplay *display = gtk_widget_get_display (widget); + GdkCursor *cursor; + if (gimp_spin_scale_on_number (widget, event->x, event->y)) - { - GdkDisplay *display = gtk_widget_get_display (widget); - GdkCursor *cursor; - - cursor = gdk_cursor_new_for_display (display, GDK_XTERM); - gdk_window_set_cursor (event->window, cursor); - gdk_cursor_unref (cursor); - } + cursor = gdk_cursor_new_for_display (display, GDK_XTERM); else - { - GdkDisplay *display = gtk_widget_get_display (widget); - GdkCursor *cursor; + cursor = gdk_cursor_new_for_display (display, GDK_LEFT_PTR); - cursor = gdk_cursor_new_for_display (display, GDK_LEFT_PTR); - gdk_window_set_cursor (event->window, cursor); - gdk_cursor_unref (cursor); - } + gdk_window_set_cursor (event->window, cursor); + gdk_cursor_unref (cursor); } return FALSE;