diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-01-08 09:04:25 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-01-08 09:04:25 -0500 |
| commit | bafd9e9edcff0e18a03ef6f4e73d673e12a7c7ed (patch) | |
| tree | e4ecbd36f3606c4decbb93de4f45a875491b0c36 /openbox/menuframe.c | |
| parent | 70c074afe84ddbe4058f67a1fce062a769b449fc (diff) | |
make Home and End keys navigate to top/bottom of the active menu
Diffstat (limited to 'openbox/menuframe.c')
| -rw-r--r-- | openbox/menuframe.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 3d2b4302..f013bdec 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -1316,3 +1316,35 @@ void menu_frame_select_next(ObMenuFrame *self) } menu_frame_select(self, it ? it->data : NULL, FALSE); } + +void menu_frame_select_first(ObMenuFrame *self) +{ + GList *it = NULL; + + if (self->entries) { + for (it = self->entries; it; it = g_list_next(it)) { + ObMenuEntryFrame *e = it->data; + if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) + break; + if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) + break; + } + } + menu_frame_select(self, it ? it->data : NULL, FALSE); +} + +void menu_frame_select_last(ObMenuFrame *self) +{ + GList *it = NULL; + + if (self->entries) { + for (it = g_list_last(self->entries); it; it = g_list_previous(it)) { + ObMenuEntryFrame *e = it->data; + if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) + break; + if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) + break; + } + } + menu_frame_select(self, it ? it->data : NULL, FALSE); +} |
