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.
This commit is contained in:
2026-05-12 14:19:46 +02:00
parent f16d8f5c78
commit b8d289a847
+7 -1
View File
@@ -144,16 +144,22 @@ 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;
const float MinOtherSlotsWidth = 200f;
if (contentRegionMax - versionWidth > MinOtherSlotsWidth)
{
ImGui.SameLine(contentRegionMax - versionWidth);
using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(theme.Colors.TextMuted)))
{
ImGui.TextUnformatted(versionText);
}
}
}
private static void DrawDot(uint rgba)
{