menu: allow overwriting submenu icon

Allow overwriting the icon of item linking to another menu like below
(the icon for "krita" should be shown):

<openbox_menu>
  <menu id="static-menu" label="Static Menu" icon="mpv" />
  <menu id="root-menu" label="Root">
    <menu id="static-menu" icon="krita" />
  </menu>
</openbox_menu>

This commit also fixes my mistake in 17d66e5 (s/parent->icon/menu->icon/)
that showed incorrect icon in an item linking to another menu.
This commit is contained in:
tokyo4j 2025-08-15 02:38:02 +09:00 committed by Johan Malm
parent 2a039d4f24
commit 72e1945a4c

View file

@ -613,7 +613,7 @@ fill_menu(struct server *server, struct menu *parent, xmlNode *n)
} }
struct menuitem *item = item_create(parent, menu->label, struct menuitem *item = item_create(parent, menu->label,
parent->icon_name, true); icon_name ? icon_name : menu->icon_name, true);
item->submenu = menu; item->submenu = menu;
} }
error: error: