Mercurial > pidgin.yaz
changeset 18874:5dd1cfc53666
Make the menus a little more usable.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 11 Aug 2007 05:09:33 +0000 |
parents | 7066896f6628 |
children | 6a911f06aa46 |
files | finch/libgnt/gntmenu.c |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/libgnt/gntmenu.c Sat Aug 11 04:19:32 2007 +0000 +++ b/finch/libgnt/gntmenu.c Sat Aug 11 05:09:33 2007 +0000 @@ -251,7 +251,8 @@ return (gnt_widget_key_pressed(GNT_WIDGET(menu), text)); } - if (text[0] == 27 && text[1] == 0) { + if ((text[0] == 27 && text[1] == 0) || + (menu->type != GNT_MENU_TOPLEVEL && strcmp(text, GNT_KEY_LEFT) == 0)) { /* Escape closes menu */ GntMenu *par = menu->parentmenu; if (par != NULL) { @@ -271,7 +272,8 @@ menu->selected++; if (menu->selected >= g_list_length(menu->list)) menu->selected = 0; - } else if (strcmp(text, GNT_KEY_ENTER) == 0) { + } else if (strcmp(text, GNT_KEY_ENTER) == 0 || + strcmp(text, GNT_KEY_DOWN) == 0) { gnt_widget_activate(widget); } @@ -283,6 +285,12 @@ if (text[1] == '\0') { if (check_for_trigger(menu, text[0])) return TRUE; + } else if (strcmp(text, GNT_KEY_RIGHT) == 0) { + GntMenuItem *item = gnt_tree_get_selection_data(GNT_TREE(menu)); + if (item && item->submenu) { + menuitem_activate(menu, item); + return TRUE; + } } return org_key_pressed(widget, text); }