gimp r24895 - in branches/gimp-2-4: . app/display app/tools app/widgets libgimpwidgets plug-ins/script-fu



Author: mitch
Date: Sat Feb 16 17:53:44 2008
New Revision: 24895
URL: http://svn.gnome.org/viewvc/gimp?rev=24895&view=rev

Log:
2008-02-16  Michael Natterer  <mitch gimp org>

	Merged from trunk:

	* app/display/gimpdisplayshell-callbacks.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimprectangletool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimppaletteview.c
	* libgimpwidgets/gimpcolorhexentry.c
	* libgimpwidgets/gimpnumberpairentry.c
	* plug-ins/script-fu/script-fu-console.c: Unify the handling of
	various "Enter" and "Space" keysyms all over the place. Fixes bug
	#516544 (also see gtk bug #515047).



Modified:
   branches/gimp-2-4/ChangeLog
   branches/gimp-2-4/app/display/gimpdisplayshell-callbacks.c
   branches/gimp-2-4/app/tools/gimpforegroundselecttool.c
   branches/gimp-2-4/app/tools/gimpimagemaptool.c
   branches/gimp-2-4/app/tools/gimpiscissorstool.c
   branches/gimp-2-4/app/tools/gimptransformtool.c
   branches/gimp-2-4/app/tools/gimpvectortool.c
   branches/gimp-2-4/app/widgets/gimpcontainerpopup.c
   branches/gimp-2-4/app/widgets/gimppaletteview.c
   branches/gimp-2-4/libgimpwidgets/gimpcolorhexentry.c
   branches/gimp-2-4/libgimpwidgets/gimpnumberpairentry.c
   branches/gimp-2-4/plug-ins/script-fu/script-fu-console.c

Modified: branches/gimp-2-4/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- branches/gimp-2-4/app/display/gimpdisplayshell-callbacks.c	(original)
+++ branches/gimp-2-4/app/display/gimpdisplayshell-callbacks.c	Sat Feb 16 17:53:44 2008
@@ -145,7 +145,8 @@
 
             if (event->type == GDK_KEY_PRESS)
               {
-                if (kevent->keyval == GDK_space && shell->space_release_pending)
+                if ((kevent->keyval == GDK_space ||
+                     kevent->keyval == GDK_KP_Space) && shell->space_release_pending)
                   {
                     shell->space_pressed         = TRUE;
                     shell->space_release_pending = FALSE;
@@ -153,7 +154,8 @@
               }
             else
               {
-                if (kevent->keyval == GDK_space && shell->space_pressed)
+                if ((kevent->keyval == GDK_space ||
+                     kevent->keyval == GDK_KP_Space) && shell->space_pressed)
                   {
                     shell->space_pressed         = FALSE;
                     shell->space_release_pending = TRUE;
@@ -168,12 +170,15 @@
           case GDK_Left:      case GDK_Right:
           case GDK_Up:        case GDK_Down:
           case GDK_space:
+          case GDK_KP_Space:
           case GDK_Tab:
           case GDK_ISO_Left_Tab:
           case GDK_Alt_L:     case GDK_Alt_R:
           case GDK_Shift_L:   case GDK_Shift_R:
           case GDK_Control_L: case GDK_Control_R:
-          case GDK_Return:    case GDK_KP_Enter:
+          case GDK_Return:
+          case GDK_KP_Enter:
+          case GDK_ISO_Enter:
           case GDK_BackSpace: case GDK_Delete:
             break;
 
@@ -1306,6 +1311,7 @@
             {
             case GDK_Return:
             case GDK_KP_Enter:
+            case GDK_ISO_Enter:
             case GDK_BackSpace:
             case GDK_Delete:
             case GDK_Escape:
@@ -1329,6 +1335,7 @@
               break;
 
             case GDK_space:
+            case GDK_KP_Space:
               gimp_display_shell_space_pressed (shell, state, time);
               return_val = TRUE;
               break;
@@ -1417,6 +1424,7 @@
           switch (kevent->keyval)
             {
             case GDK_space:
+            case GDK_KP_Space:
               gimp_display_shell_space_released (shell, state, time);
               return_val = TRUE;
               break;

Modified: branches/gimp-2-4/app/tools/gimpforegroundselecttool.c
==============================================================================
--- branches/gimp-2-4/app/tools/gimpforegroundselecttool.c	(original)
+++ branches/gimp-2-4/app/tools/gimpforegroundselecttool.c	Sat Feb 16 17:53:44 2008
@@ -398,8 +398,9 @@
 
   switch (kevent->keyval)
     {
-    case GDK_KP_Enter:
     case GDK_Return:
+    case GDK_KP_Enter:
+    case GDK_ISO_Enter:
       gimp_foreground_select_tool_apply (fg_select, display);
       return TRUE;
 

Modified: branches/gimp-2-4/app/tools/gimpimagemaptool.c
==============================================================================
--- branches/gimp-2-4/app/tools/gimpimagemaptool.c	(original)
+++ branches/gimp-2-4/app/tools/gimpimagemaptool.c	Sat Feb 16 17:53:44 2008
@@ -356,8 +356,9 @@
     {
       switch (kevent->keyval)
         {
-        case GDK_KP_Enter:
         case GDK_Return:
+        case GDK_KP_Enter:
+        case GDK_ISO_Enter:
           gimp_image_map_tool_response (NULL, GTK_RESPONSE_OK, image_map_tool);
           return TRUE;
 

Modified: branches/gimp-2-4/app/tools/gimpiscissorstool.c
==============================================================================
--- branches/gimp-2-4/app/tools/gimpiscissorstool.c	(original)
+++ branches/gimp-2-4/app/tools/gimpiscissorstool.c	Sat Feb 16 17:53:44 2008
@@ -1053,8 +1053,9 @@
 
   switch (kevent->keyval)
     {
-    case GDK_KP_Enter:
     case GDK_Return:
+    case GDK_KP_Enter:
+    case GDK_ISO_Enter:
       if (iscissors->connected && iscissors->mask)
         {
           gimp_iscissors_tool_apply (iscissors, display);

Modified: branches/gimp-2-4/app/tools/gimptransformtool.c
==============================================================================
--- branches/gimp-2-4/app/tools/gimptransformtool.c	(original)
+++ branches/gimp-2-4/app/tools/gimptransformtool.c	Sat Feb 16 17:53:44 2008
@@ -505,8 +505,9 @@
     {
       switch (kevent->keyval)
         {
-        case GDK_KP_Enter:
         case GDK_Return:
+        case GDK_KP_Enter:
+        case GDK_ISO_Enter:
           gimp_transform_tool_response (NULL, GTK_RESPONSE_OK, trans_tool);
           return TRUE;
 

Modified: branches/gimp-2-4/app/tools/gimpvectortool.c
==============================================================================
--- branches/gimp-2-4/app/tools/gimpvectortool.c	(original)
+++ branches/gimp-2-4/app/tools/gimpvectortool.c	Sat Feb 16 17:53:44 2008
@@ -767,8 +767,9 @@
 
   switch (kevent->keyval)
     {
-    case GDK_KP_Enter:
     case GDK_Return:
+    case GDK_KP_Enter:
+    case GDK_ISO_Enter:
       gimp_vector_tool_to_selection_extended (vector_tool, kevent->state);
       break;
 

Modified: branches/gimp-2-4/app/widgets/gimpcontainerpopup.c
==============================================================================
--- branches/gimp-2-4/app/widgets/gimpcontainerpopup.c	(original)
+++ branches/gimp-2-4/app/widgets/gimpcontainerpopup.c	Sat Feb 16 17:53:44 2008
@@ -123,8 +123,12 @@
                                 "confirm", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0,
                                 "confirm", 0);
+  gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0,
+                                "confirm", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
                                 "confirm", 0);
+  gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
+                                "confirm", 0);
 }
 
 static void

Modified: branches/gimp-2-4/app/widgets/gimppaletteview.c
==============================================================================
--- branches/gimp-2-4/app/widgets/gimppaletteview.c	(original)
+++ branches/gimp-2-4/app/widgets/gimppaletteview.c	Sat Feb 16 17:53:44 2008
@@ -268,9 +268,11 @@
   GimpPaletteView *view = GIMP_PALETTE_VIEW (widget);
 
   if (view->selected &&
-      (kevent->keyval == GDK_space  ||
-       kevent->keyval == GDK_Return ||
-       kevent->keyval == GDK_KP_Enter))
+      (kevent->keyval == GDK_space    ||
+       kevent->keyval == GDK_KP_Space ||
+       kevent->keyval == GDK_Return   ||
+       kevent->keyval == GDK_KP_Enter ||
+       kevent->keyval == GDK_ISO_Enter))
     {
       g_signal_emit (view, view_signals[ENTRY_CLICKED], 0,
                      view->selected, kevent->state);

Modified: branches/gimp-2-4/libgimpwidgets/gimpcolorhexentry.c
==============================================================================
--- branches/gimp-2-4/libgimpwidgets/gimpcolorhexentry.c	(original)
+++ branches/gimp-2-4/libgimpwidgets/gimpcolorhexentry.c	Sat Feb 16 17:53:44 2008
@@ -216,39 +216,48 @@
                              GdkEvent  *event)
 {
   GimpColorHexEntry *entry = GIMP_COLOR_HEX_ENTRY (widget);
-  const gchar       *text;
-  gchar              buffer[8];
-  guchar             r, g, b;
 
   switch (event->type)
     {
     case GDK_KEY_PRESS:
-      if (((GdkEventKey *) event)->keyval != GDK_Return)
-        break;
-      /*  else fall through  */
+      {
+        GdkEventKey *kevent = (GdkEventKey *) event;
 
-    case GDK_FOCUS_CHANGE:
-      text = gtk_entry_get_text (GTK_ENTRY (widget));
-
-      gimp_rgb_get_uchar (&entry->color, &r, &g, &b);
-      g_snprintf (buffer, sizeof (buffer), "%.2x%.2x%.2x", r, g, b);
+        if (kevent->keyval != GDK_Return   &&
+            kevent->keyval != GDK_KP_Enter &&
+            kevent->keyval != GDK_ISO_Enter)
+          break;
+        /*  else fall through  */
+      }
 
-      if (g_ascii_strcasecmp (buffer, text) != 0)
-        {
-          GimpRGB  color;
-          gsize    len = strlen (text);
-
-          if (len > 0 &&
-              (gimp_rgb_parse_hex (&color, text, len) ||
-               gimp_rgb_parse_name (&color, text, -1)))
-            {
-              gimp_color_hex_entry_set_color (entry, &color);
-            }
-          else
-            {
-              gtk_entry_set_text (GTK_ENTRY (entry), buffer);
-            }
-        }
+    case GDK_FOCUS_CHANGE:
+      {
+        const gchar *text;
+        gchar        buffer[8];
+        guchar       r, g, b;
+
+        text = gtk_entry_get_text (GTK_ENTRY (widget));
+
+        gimp_rgb_get_uchar (&entry->color, &r, &g, &b);
+        g_snprintf (buffer, sizeof (buffer), "%.2x%.2x%.2x", r, g, b);
+
+        if (g_ascii_strcasecmp (buffer, text) != 0)
+          {
+            GimpRGB  color;
+            gsize    len = strlen (text);
+
+            if (len > 0 &&
+                (gimp_rgb_parse_hex (&color, text, len) ||
+                 gimp_rgb_parse_name (&color, text, -1)))
+              {
+                gimp_color_hex_entry_set_color (entry, &color);
+              }
+            else
+              {
+                gtk_entry_set_text (GTK_ENTRY (entry), buffer);
+              }
+          }
+      }
       break;
 
     default:

Modified: branches/gimp-2-4/libgimpwidgets/gimpnumberpairentry.c
==============================================================================
--- branches/gimp-2-4/libgimpwidgets/gimpnumberpairentry.c	(original)
+++ branches/gimp-2-4/libgimpwidgets/gimpnumberpairentry.c	Sat Feb 16 17:53:44 2008
@@ -818,7 +818,9 @@
       {
         GdkEventKey *kevent = (GdkEventKey *) event;
 
-        if (kevent->keyval != GDK_Return)
+        if (kevent->keyval != GDK_Return   &&
+            kevent->keyval != GDK_KP_Enter &&
+            kevent->keyval != GDK_ISO_Enter)
           break;
 
         /* If parsing was done due to widgets focus being lost, we only change

Modified: branches/gimp-2-4/plug-ins/script-fu/script-fu-console.c
==============================================================================
--- branches/gimp-2-4/plug-ins/script-fu/script-fu-console.c	(original)
+++ branches/gimp-2-4/plug-ins/script-fu/script-fu-console.c	Sat Feb 16 17:53:44 2008
@@ -564,6 +564,8 @@
   switch (event->keyval)
     {
     case GDK_Return:
+    case GDK_KP_Enter:
+    case GDK_ISO_Enter:
       if (script_fu_cc_is_empty (console))
         return TRUE;
 



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