summaryrefslogtreecommitdiff
path: root/openbox/menuframe.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-08-29 08:44:55 +0000
committerDana Jansens <danakj@orodu.net>2003-08-29 08:44:55 +0000
commitdcdc325f5c8c946df696d17a6da329aeac149586 (patch)
tree2790687d65f79bf5b81712d97756e5032c3a2bc4 /openbox/menuframe.c
parent43fded6a10351a8f9f99344a102d79ece6afe8a8 (diff)
ultra-keyboard-controlled-menus
Diffstat (limited to 'openbox/menuframe.c')
-rw-r--r--openbox/menuframe.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/openbox/menuframe.c b/openbox/menuframe.c
index a1b06e10..0b90df6e 100644
--- a/openbox/menuframe.c
+++ b/openbox/menuframe.c
@@ -627,3 +627,49 @@ void menu_entry_frame_execute(ObMenuEntryFrame *self, gboolean hide)
}
}
}
+
+void menu_frame_select_previous(ObMenuFrame *self)
+{
+ GList *it = NULL, *start;
+
+ if (self->entries) {
+ start = it = g_list_find(self->entries, self->selected);
+ while (TRUE) {
+ ObMenuEntryFrame *e;
+
+ it = it ? g_list_previous(it) : g_list_last(self->entries);
+ if (it == start)
+ break;
+
+ if (it) {
+ e = it->data;
+ if (e->entry->type != OB_MENU_ENTRY_TYPE_SEPARATOR)
+ break;
+ }
+ }
+ }
+ menu_frame_select(self, it ? it->data : NULL);
+}
+
+void menu_frame_select_next(ObMenuFrame *self)
+{
+ GList *it = NULL, *start;
+
+ if (self->entries) {
+ start = it = g_list_find(self->entries, self->selected);
+ while (TRUE) {
+ ObMenuEntryFrame *e;
+
+ it = it ? g_list_next(it) : self->entries;
+ if (it == start)
+ break;
+
+ if (it) {
+ e = it->data;
+ if (e->entry->type != OB_MENU_ENTRY_TYPE_SEPARATOR)
+ break;
+ }
+ }
+ }
+ menu_frame_select(self, it ? it->data : NULL);
+}