diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-04-22 00:36:54 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-04-22 00:36:54 +0000 |
| commit | 957963e272be1fba1e06dd2bdcfa9a4348121baf (patch) | |
| tree | 03b239699cc3472652ecf63605ff4df88b80f588 /openbox/menu.c | |
| parent | 854b2ae68498133f3119ec614b725025af3fd66b (diff) | |
1) get rid of menu titles
2) let separators have labels, when they have a label, then they will appear like a menu title used to
so if you want a menu title, you use a separator in the menu itself at the top
more style work may be needed
Diffstat (limited to 'openbox/menu.c')
| -rw-r--r-- | openbox/menu.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/openbox/menu.c b/openbox/menu.c index a2902ed8..e2436810 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -2,7 +2,7 @@ menu.c for the Openbox window manager Copyright (c) 2006 Mikael Magnusson - Copyright (c) 2003 Ben Jansens + Copyright (c) 2003-2007 Dana Jansens This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -201,8 +201,15 @@ static void parse_menu_separator(ObParseInst *i, { ObMenuParseState *state = data; - if (state->parent) - menu_add_separator(state->parent, -1); + if (state->parent) { + gchar *label; + + if (!parse_attr_string("label", node, &label)) + label = NULL; + + menu_add_separator(state->parent, -1, label); + g_free(label); + } } static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, @@ -414,11 +421,12 @@ ObMenuEntry* menu_add_submenu(ObMenu *self, gint id, const gchar *submenu) return e; } -ObMenuEntry* menu_add_separator(ObMenu *self, gint id) +ObMenuEntry* menu_add_separator(ObMenu *self, gint id, const gchar *label) { ObMenuEntry *e; e = menu_entry_new(self, OB_MENU_ENTRY_TYPE_SEPARATOR, id); + e->data.separator.label = g_strdup(label); self->entries = g_list_append(self->entries, e); return e; |
