Bar icon dropdown: barMenu on plugin windows (API v95) #13

Open
AwfulWaffle wants to merge 26 commits from AwfulWaffle/RynthCore:bar-menu into main
Showing only changes of commit 0e9ce0ac88 - Show all commits

Bar menu: centre the dropdown under its icon

The window's left edge sat on the icon's left edge, so its padding pushed the
icons right of the parent. Centre the window on the icon instead (still clamped
to the viewport).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Daniel Wallace 2026-11-07 20:55:27 -08:00

View file

@ -585,7 +585,7 @@ internal static class ImGuiBar
Vector2 display = ImGuiNET.ImGui.GetIO().DisplaySize;
float width = square.X + 8f * s; // WindowPadding (4, 3) each side
float height = items.Length * square.Y + (items.Length - 1) * ButtonGap * s + 6f * s;
float x = min.X, y = max.Y;
float x = (min.X + max.X - width) * 0.5f, y = max.Y; // centred under the icon
if (display.X > 1 && display.Y > 1)
{
if (y + height > display.Y && min.Y - height >= 0f) y = min.Y - height; // flush above instead