From b8d289a84704d36768f02d494c4842c16bbbf970 Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Tue, 12 May 2026 14:19:46 +0200 Subject: [PATCH] fix(ui): hide status bar version when window is too narrow Below roughly 340 px content width the version slot starts overlapping the four slots to its left because the right-aligned SameLine still plants the text where its baseline would have been. New 200 px width threshold drops the version line entirely below that, so the other slots stay readable. The version is back as soon as the window grows. --- HellionChat/Ui/StatusBar.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/HellionChat/Ui/StatusBar.cs b/HellionChat/Ui/StatusBar.cs index 71c8d62..8883b92 100644 --- a/HellionChat/Ui/StatusBar.cs +++ b/HellionChat/Ui/StatusBar.cs @@ -144,14 +144,20 @@ internal sealed class StatusBar ImGui.TextUnformatted(_cachedTellsText); } - // Slot 5: version, right-aligned, muted + // Slot 5: version, right-aligned, muted. Hidden when the window is + // too narrow to fit all five slots — the other four need ~200 px + // before the version text starts clipping into them. var versionText = $"v{Plugin.Interface.Manifest.AssemblyVersion} · Hellion"; var versionWidth = ImGui.CalcTextSize(versionText).X; var contentRegionMax = ImGui.GetContentRegionMax().X; - ImGui.SameLine(contentRegionMax - versionWidth); - using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(theme.Colors.TextMuted))) + const float MinOtherSlotsWidth = 200f; + if (contentRegionMax - versionWidth > MinOtherSlotsWidth) { - ImGui.TextUnformatted(versionText); + ImGui.SameLine(contentRegionMax - versionWidth); + using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(theme.Colors.TextMuted))) + { + ImGui.TextUnformatted(versionText); + } } }