[maemo-commits] [maemo-commits] r11564 - in projects/haf/trunk/gtk+: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu May 10 13:49:25 EEST 2007
Author: mitch
Date: 2007-05-10 13:49:24 +0300 (Thu, 10 May 2007)
New Revision: 11564

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkmenushell.c
Log:
2007-05-10  Michael Natterer  <mitch at gimp.org>

	* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): add a
	MAEMO_CHANGES patch that closes the menu on MENU_DIR_PARENT even
	it if has no submenu. Together with a small gtkrc snippet this
	will fix the behavior of the Escape key.



Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2007-05-10 07:12:38 UTC (rev 11563)
+++ projects/haf/trunk/gtk+/ChangeLog	2007-05-10 10:49:24 UTC (rev 11564)
@@ -1,3 +1,10 @@
+2007-05-10  Michael Natterer  <mitch at gimp.org>
+
+	* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current): add a
+	MAEMO_CHANGES patch that closes the menu on MENU_DIR_PARENT even
+	it if has no submenu. Together with a small gtkrc snippet this
+	will fix the behavior of the Escape key.
+
 2007-05-02  Kristian Rietveld  <kris at imendio.com>
 
 	* gtk/gtktreeview.c (gtk_tree_view_grab_notify): stop the rubber

Modified: projects/haf/trunk/gtk+/gtk/gtkmenushell.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkmenushell.c	2007-05-10 07:12:38 UTC (rev 11563)
+++ projects/haf/trunk/gtk+/gtk/gtkmenushell.c	2007-05-10 10:49:24 UTC (rev 11564)
@@ -1357,6 +1357,17 @@
 	      gtk_menu_shell_select_submenu_first (parent_menu_shell);
 	    }
 	}
+#ifdef MAEMO_CHANGES
+      else
+        {
+          /* In maemo, the escape key should close one menu hierarchy.
+           * Earlier versions had a separate "close" signal for that.
+           * Now we simply bind escape to move_current(GTK_MENU_DIR_PARENT)
+           * and have this tiny one-liner instead.
+           */
+          gtk_real_menu_shell_cancel (menu_shell);
+        }
+#else
       /* If there is no parent and the submenu is in the opposite direction
        * to the menu, then make the PARENT direction wrap around to
        * the bottom of the submenu.
@@ -1371,6 +1382,7 @@
 	      GTK_MENU_SHELL_GET_CLASS (submenu)->submenu_placement)
 	    _gtk_menu_shell_select_last (submenu, TRUE);
 	}
+#endif /* MAEMO_CHANGES */
       break;
 
     case GTK_MENU_DIR_CHILD:


More information about the maemo-commits mailing list