summaryrefslogtreecommitdiff
path: root/gtk/gtkmenuitem.h
diff options
context:
space:
mode:
authorMichael Natterer <mitch@imendio.com>2007-04-27 14:49:37 +0000
committerMichael Natterer <mitch@src.gnome.org>2007-04-27 14:49:37 +0000
commit533d3fcc76b39fc4c71afae9c2a31e8147851b8c (patch)
treee920ae1729522ef4580cca5134faa28bd64deb5e /gtk/gtkmenuitem.h
parent069d78ed31fc1c0a9cb7621d27fe10d7b974315b (diff)
downloadgtk+-533d3fcc76b39fc4c71afae9c2a31e8147851b8c.tar.gz
Merged heavily modified patch from maemo-gtk which enables opening and
2007-04-27 Michael Natterer <mitch@imendio.com> Merged heavily modified patch from maemo-gtk which enables opening and closing submenus on click, and introduces some usability changes when gtk-touchscreen-mode is enabled (bug #128968): * gtk/gtkmenushell.c (struct GtkMenuShellPrivate): added boolean "activated_submenu" to indicate that the current mouse operation (click or drag) has opened a submenu. (gtk_menu_shell_button_press): pop up submenus without delay and record the fact in "activated_submenu". (gtk_menu_shell_button_release): if a submenu was explicitely opened, or not opened by this release's button_press, or enough time has passed since timeout-opening it, close the submenu here. (gtk_menu_shell_enter_notify): when entering a menu item with any mouse button pressed, open its submenu. (gtk_real_menu_shell_move_current): in touchsreen mode, close the submenu when moving the focus away from it via keyboard-navigation. * gtk/gtkmenuitem.[ch] (_gtk_menu_item_popup_submenu): added parameter "gboolean with_delay" so GtkMenuShell can control this for the different scenarios of submenu showing. (_gtk_menu_item_popdown_submenu): new function. also needed by GtkMenuShell for closing submenus on click. Renamed internal function gtk_menu_item_select_timeout() to gtk_menu_item_popup_timeout(). (gtk_menu_item_real_popup_submenu): new utility function which does the actual popup and records the exact time of the popup when the menu was timeout-opened (using g_get_current_time()). (gtk_real_menu_item_select): don't add the popup timeout when in touchscreen mode. * gtk/gtkmenu.c (gtk_menu_popup): in touchscreen mode, select the first item of every opened menu. svn path=/trunk/; revision=17659
Diffstat (limited to 'gtk/gtkmenuitem.h')
-rw-r--r--gtk/gtkmenuitem.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtkmenuitem.h b/gtk/gtkmenuitem.h
index e76087b601..84e9f43d2e 100644
--- a/gtk/gtkmenuitem.h
+++ b/gtk/gtkmenuitem.h
@@ -119,7 +119,9 @@ void _gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item,
GtkAccelGroup *accel_group,
gboolean group_changed);
gboolean _gtk_menu_item_is_selectable (GtkWidget *menu_item);
-void _gtk_menu_item_popup_submenu (GtkWidget *menu_item);
+void _gtk_menu_item_popup_submenu (GtkWidget *menu_item,
+ gboolean with_delay);
+void _gtk_menu_item_popdown_submenu (GtkWidget *menu_item);
#ifndef GTK_DISABLE_DEPRECATED
#define gtk_menu_item_right_justify(menu_item) gtk_menu_item_set_right_justified ((menu_item), TRUE)