diff finch/libgnt/gntwindow.c @ 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 261fd722db1f
children 88d889b54df4
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;