diff --git a/HellionChat/Ui/Components/InputBar.cs b/HellionChat/Ui/Components/InputBar.cs index 55bb2d0..47dfe8f 100644 --- a/HellionChat/Ui/Components/InputBar.cs +++ b/HellionChat/Ui/Components/InputBar.cs @@ -26,9 +26,9 @@ namespace HellionChat.Ui.Components; // the current game-side channel. internal sealed class InputBar { - public const float Height = 32f; - private const float PillHeight = 22f; - private const float PillPaddingX = 8f; + // Scaled: MainWindow and ChannelPopoutWindow both reserve against this, so + // they follow automatically. The pill's own metrics live in PillStyle now. + public static float Height => StyleEngine.Metrics.InputBarHeight; private const int BufferCapacity = 500; private const float QuickButtonsReserve = 130f; @@ -257,19 +257,15 @@ internal sealed class InputBar private void DrawChannelPill(Tab? tab, bool isTell, uint pillAbgr, uint textAbgr) { var label = ResolvePillLabel(tab, isTell); - var labelSize = ImGui.CalcTextSize(label); - var width = labelSize.X + PillPaddingX * 2; + var size = StyleEngine.Widgets.Pill.CalcSize(label, withDot: false); var origin = ImGui.GetCursorScreenPos(); - var dl = ImGui.GetWindowDrawList(); - var max = origin + new Vector2(width, PillHeight); - dl.AddRectFilled(origin, max, pillAbgr, 6f); - dl.AddText(origin + new Vector2(PillPaddingX, 3f), textAbgr, label); + StyleEngine.Widgets.Pill.Draw(origin, label, pillAbgr, textAbgr); // Hit area over the rendered pill so a click opens the channel // picker. InvisibleButton both reserves the layout slot and gives // the popup a stable anchor item. - ImGui.InvisibleButton("##hellion-pill", new Vector2(width, PillHeight)); + ImGui.InvisibleButton("##hellion-pill", size); if (ImGui.IsItemClicked() && tab is not null) ImGui.OpenPopup("##hellion-channel-picker");