]> git.mdlowis.com Git - proto/labwc.git/commitdiff
menu: allow overwriting submenu icon
authortokyo4j <hrak1529@gmail.com>
Thu, 14 Aug 2025 17:38:02 +0000 (02:38 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 14 Aug 2025 19:47:43 +0000 (20:47 +0100)
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.

src/menu/menu.c

index 0009861d81e0dfb99e7bef0f9d500950980b205b..69527ce0616d36f47ba210eda054ff1508b5b7b7 100644 (file)
@@ -613,7 +613,7 @@ fill_menu(struct server *server, struct menu *parent, xmlNode *n)
                }
 
                struct menuitem *item = item_create(parent, menu->label,
-                       parent->icon_name, true);
+                       icon_name ? icon_name : menu->icon_name, true);
                item->submenu = menu;
        }
 error: