From 22fb8cc13c7cbd6e5a0cd5fec6d5072f68a2d1c0 Mon Sep 17 00:00:00 2001 From: iisaev Date: Wed, 21 Oct 2026 19:18:35 +0200 Subject: [PATCH] Menu buttons keep entry icons text-sized (icon_max_width) --- src/Menu/MenuBuilder.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Menu/MenuBuilder.cs b/src/Menu/MenuBuilder.cs index 2241724..f156518 100644 --- a/src/Menu/MenuBuilder.cs +++ b/src/Menu/MenuBuilder.cs @@ -90,6 +90,9 @@ namespace Cthangover.Mods.Interface.Menu } } + /// Largest icon width of a menu button, so an entry icon never makes its row taller than the text rows. + private const int MenuIconSize = 22; + private static Button CreateButton(Control menuRoot, MenuButtonEntry entry) { var title = TranslationServer.Translate(entry.Locale); @@ -104,7 +107,11 @@ namespace Cthangover.Mods.Interface.Menu { var icon = UIIconFactory.Instance.Get(entry.Icon); if (icon != null) + { + // Entry icons are toolbar icons (60 px); in a menu row they stay text-sized. button.Icon = icon; + button.AddThemeConstantOverride("icon_max_width", MenuIconSize); + } } if (!string.IsNullOrEmpty(entry.Variation))