Compare commits

..
2 Commits
Author SHA1 Message Date
cthangover 7dd97768d9 Mod cover 2026-10-22 17:09:44 +02:00
cthangover 22fb8cc13c Menu buttons keep entry icons text-sized (icon_max_width) 2026-10-21 19:18:35 +02:00
3 changed files with 7 additions and 0 deletions

No files matched your search

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

+7
View File
@@ -90,6 +90,9 @@ namespace Cthangover.Mods.Interface.Menu
} }
} }
/// <summary>Largest icon width of a menu button, so an entry icon never makes its row taller than the text rows.</summary>
private const int MenuIconSize = 22;
private static Button CreateButton(Control menuRoot, MenuButtonEntry entry) private static Button CreateButton(Control menuRoot, MenuButtonEntry entry)
{ {
var title = TranslationServer.Translate(entry.Locale); var title = TranslationServer.Translate(entry.Locale);
@@ -104,7 +107,11 @@ namespace Cthangover.Mods.Interface.Menu
{ {
var icon = UIIconFactory.Instance.Get(entry.Icon); var icon = UIIconFactory.Instance.Get(entry.Icon);
if (icon != null) if (icon != null)
{
// Entry icons are toolbar icons (60 px); in a menu row they stay text-sized.
button.Icon = icon; button.Icon = icon;
button.AddThemeConstantOverride("icon_max_width", MenuIconSize);
}
} }
if (!string.IsNullOrEmpty(entry.Variation)) if (!string.IsNullOrEmpty(entry.Variation))