fix(statusbar): make height DPI-aware via GetTextLineHeightWithSpacing
Replace the fixed 22px const Height with a computed property that bakes in the ImGui font line height plus a GlobalScale-rounded 2px spacer. The constant clipped the bottom bar on Windows display-scaling >100% because ImGui rendered the actual font taller than 22px; the bar then got pushed off the window edge. ChatLogWindow.cs:423 reservation drops the explicit +2 because the spacer now lives inside Height. Same idiom as the v1.4.6 F7.2 underline pill in ChatLogWindow.cs:1639-1653. v1.4.8 B1. Coverage via in-game smoke on Windows (Jin) and Linux/Wayland in Task 9 -- DrawList-coupled, no Build-Suite test.
This commit is contained in:
@@ -419,8 +419,9 @@ public sealed class ChatLogWindow : Window
|
||||
// The hint banner renders before this block so ImGui already accounts for it.
|
||||
height -= ImGui.GetFrameHeightWithSpacing();
|
||||
|
||||
// Status bar at the window bottom reserves 22px + 2px spacing.
|
||||
height -= StatusBar.Height + 2;
|
||||
// StatusBar.Height now bakes in its own DPI-aware 2px spacer, so the
|
||||
// window reservation is just Height -- no extra +2 (v1.4.8 B1).
|
||||
height -= StatusBar.Height;
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Globalization;
|
||||
using System.Numerics;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using HellionChat.Code;
|
||||
using HellionChat.Resources;
|
||||
@@ -9,12 +10,20 @@ using HellionChat.Util;
|
||||
|
||||
namespace HellionChat.Ui;
|
||||
|
||||
// Bottom status bar, 22px tall. Slots left to right: channel indicator,
|
||||
// privacy badge, counts, tells (hidden at 0), version (right-aligned).
|
||||
// Updates at 1Hz; format strings are cached between updates.
|
||||
// Bottom status bar. Slots left to right: channel indicator, privacy badge,
|
||||
// counts, tells (hidden at 0), version (right-aligned). Updates at 1Hz;
|
||||
// format strings are cached between updates.
|
||||
internal sealed class StatusBar
|
||||
{
|
||||
public const float Height = 22f;
|
||||
// DPI-aware bar height. The previous fixed 22px constant clipped on
|
||||
// Windows display-scaling >100% because ImGui renders the font bigger
|
||||
// than the reservation. GetTextLineHeightWithSpacing scales with the
|
||||
// current ImGui font; the 2px spacer is GlobalScale-rounded to stay
|
||||
// on integer pixel boundaries (same idiom as v1.4.6 F7.2 underline-pill
|
||||
// in ChatLogWindow.cs:1639-1653).
|
||||
public static float Height =>
|
||||
ImGui.GetTextLineHeightWithSpacing() + MathF.Round(2f * ImGuiHelpers.GlobalScale);
|
||||
|
||||
private const long UpdateIntervalMs = 1000;
|
||||
|
||||
// Initially outdated so the first frame always computes fresh.
|
||||
|
||||
Reference in New Issue
Block a user