]> Dogcows Code - chaz/openbox/blobdiff - openbox/menu.c
1) get rid of menu titles
[chaz/openbox] / openbox / menu.c
index a2902ed82400f6a74ebcffb569a5abc59178e8a9..e2436810791b717e3221a71a6840ca6efe194c07 100644 (file)
@@ -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;
This page took 0.024408 seconds and 4 git commands to generate.