im.pidgin.pidgin: fb4562e25805935b7f84c12cc47a028a0dc25f3a

sadrul at pidgin.im sadrul at pidgin.im
Mon Nov 26 00:45:52 EST 2007


-----------------------------------------------------------------
Revision: fb4562e25805935b7f84c12cc47a028a0dc25f3a
Ancestor: 2cbd8db1d77e345ea55b3b765ca79726273ca727
Author: sadrul at pidgin.im
Date: 2007-11-23T11:05:43
Branch: im.pidgin.pidgin

Modified files:
        finch/libgnt/gntmenu.c

ChangeLog: 

Improve the 'menu experience' a little bit.

-------------- next part --------------
============================================================
--- finch/libgnt/gntmenu.c	f5ecf5004906b3743567f5376f50aa37d622f3e6
+++ finch/libgnt/gntmenu.c	847190bb8f0f653dd972e35e28f1284135861834
@@ -47,6 +47,8 @@ static gboolean (*org_key_pressed)(GntWi
 static void (*org_size_request)(GntWidget *wid);
 static gboolean (*org_key_pressed)(GntWidget *w, const char *t);
 
+static void menuitem_activate(GntMenu *menu, GntMenuItem *item);
+
 static void
 menu_hide_all(GntMenu *menu)
 {
@@ -56,6 +58,20 @@ static void
 }
 
 static void
+show_submenu(GntMenu *menu)
+{
+	GntMenuItem *item;
+
+	if (menu->type != GNT_MENU_TOPLEVEL)
+			return;
+
+	item = g_list_nth_data(menu->list, menu->selected);
+	if (!item || !item->submenu)
+		return;
+	menuitem_activate(menu, item);
+}
+
+static void
 gnt_menu_draw(GntWidget *widget)
 {
 	GntMenu *menu = GNT_MENU(widget);
@@ -276,6 +292,8 @@ gnt_menu_key_pressed(GntWidget *widget, 
 			gnt_widget_hide(widget);
 		} else
 			gnt_widget_hide(widget);
+		if (par && par->type == GNT_MENU_TOPLEVEL)
+			gnt_menu_key_pressed(GNT_WIDGET(par), text);
 		return TRUE;
 	}
 
@@ -297,6 +315,7 @@ gnt_menu_key_pressed(GntWidget *widget, 
 			GntMenu *sub = menu->submenu;
 			if (sub)
 				gnt_widget_hide(GNT_WIDGET(sub));
+			show_submenu(menu);
 			gnt_widget_draw(widget);
 			return TRUE;
 		}


More information about the Commits mailing list