Code

Corrected focus problems by moving flag setting back to first thing
authorjoncruz <joncruz@users.sourceforge.net>
Mon, 23 Oct 2006 05:43:36 +0000 (05:43 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Mon, 23 Oct 2006 05:43:36 +0000 (05:43 +0000)
src/ege-adjustment-action.cpp

index 0584e66ba090894577bbd1be4c9bba9884f17459..a2ea9ff0db9842fc8d3b28c2134351c8feeea71f 100644 (file)
@@ -476,8 +476,8 @@ gboolean keypress_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
     switch ( key ) {
         case GDK_Escape:
         {
-            gtk_spin_button_set_value( GTK_SPIN_BUTTON(widget), action->private_data->lastVal );
             action->private_data->transferFocus = TRUE;
+            gtk_spin_button_set_value( GTK_SPIN_BUTTON(widget), action->private_data->lastVal );
             ege_adjustment_action_defocus( action );
             wasConsumed = TRUE;
         }
@@ -509,9 +509,9 @@ gboolean keypress_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
         case GDK_Up:
         case GDK_KP_Up:
         {
+            action->private_data->transferFocus = FALSE;
             gdouble val = gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) );
             gtk_spin_button_set_value( GTK_SPIN_BUTTON(widget), val + action->private_data->step );
-            action->private_data->transferFocus = FALSE;
             wasConsumed = TRUE;
         }
         break;
@@ -519,9 +519,9 @@ gboolean keypress_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
         case GDK_Down:
         case GDK_KP_Down:
         {
+            action->private_data->transferFocus = FALSE;
             gdouble val = gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) );
             gtk_spin_button_set_value( GTK_SPIN_BUTTON(widget), val - action->private_data->step );
-            action->private_data->transferFocus = FALSE;
             wasConsumed = TRUE;
         }
         break;
@@ -529,9 +529,9 @@ gboolean keypress_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
         case GDK_Page_Up:
         case GDK_KP_Page_Up:
         {
+            action->private_data->transferFocus = FALSE;
             gdouble val = gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) );
             gtk_spin_button_set_value( GTK_SPIN_BUTTON(widget), val + action->private_data->page );
-            action->private_data->transferFocus = FALSE;
             wasConsumed = TRUE;
         }
         break;
@@ -539,9 +539,9 @@ gboolean keypress_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
         case GDK_Page_Down:
         case GDK_KP_Page_Down:
         {
+            action->private_data->transferFocus = FALSE;
             gdouble val = gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) );
             gtk_spin_button_set_value( GTK_SPIN_BUTTON(widget), val - action->private_data->page );
-            action->private_data->transferFocus = FALSE;
             wasConsumed = TRUE;
         }
         break;
@@ -549,8 +549,8 @@ gboolean keypress_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
         case GDK_z:
         case GDK_Z:
         {
-            gtk_spin_button_set_value( GTK_SPIN_BUTTON(widget), action->private_data->lastVal );
             action->private_data->transferFocus = FALSE;
+            gtk_spin_button_set_value( GTK_SPIN_BUTTON(widget), action->private_data->lastVal );
             wasConsumed = TRUE;
         }
         break;