From 957963e272be1fba1e06dd2bdcfa9a4348121baf Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 22 Apr 2007 00:36:54 +0000 Subject: 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 --- openbox/menu.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'openbox/menu.c') 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; -- cgit v1.2.3