changeset 18875:6a911f06aa46

Some more navigation improvement for the menus.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 11 Aug 2007 05:23:30 +0000
parents 5dd1cfc53666
children e4a4d7ab4bf0
files finch/libgnt/gntmenu.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntmenu.c	Sat Aug 11 05:09:33 2007 +0000
+++ b/finch/libgnt/gntmenu.c	Sat Aug 11 05:23:30 2007 +0000
@@ -247,8 +247,10 @@
 	int current = menu->selected;
 
 	if (menu->submenu) {
-		do menu = menu->submenu; while (menu->submenu);
-		return (gnt_widget_key_pressed(GNT_WIDGET(menu), text));
+		GntMenu *sub = menu;
+		do sub = sub->submenu; while (sub->submenu);
+		if (gnt_widget_key_pressed(GNT_WIDGET(sub), text))
+			return TRUE;
 	}
 
 	if ((text[0] == 27 && text[1] == 0) ||
@@ -278,6 +280,11 @@
 		}
 
 		if (current != menu->selected) {
+			GntMenu *sub = menu->submenu;
+			while (sub) {
+				gnt_widget_hide(GNT_WIDGET(sub));
+				sub = sub->submenu;
+			}
 			gnt_widget_draw(widget);
 			return TRUE;
 		}