changeset 24921:253e5d3988ca

Show the submenu for the toplevel menu without requiring a keypress from the user.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 06 Jan 2009 16:19:16 +0000
parents ea28a7b9113c
children cead8692e35f
files finch/libgnt/gntwindow.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntwindow.c	Tue Jan 06 15:34:26 2009 +0000
+++ b/finch/libgnt/gntwindow.c	Tue Jan 06 16:19:16 2009 +0000
@@ -49,7 +49,16 @@
 {
 	GntWindow *win = GNT_WINDOW(bind);
 	if (win->menu) {
-		gnt_screen_menu_show(win->menu);
+		GntMenu *menu = win->menu;
+
+		gnt_screen_menu_show(menu);
+		if (menu->type == GNT_MENU_TOPLEVEL) {
+			GntMenuItem *item;
+			item = g_list_nth_data(menu->list, menu->selected);
+			if (item && gnt_menuitem_get_submenu(item)) {
+				gnt_widget_activate(GNT_WIDGET(menu));
+			}
+		}
 		return TRUE;
 	}
 	return FALSE;