fix(sidebar): top-padding mirrors header toolbar height, restore standard button height

Sidebar buttons sat at the window top while messages began below the
chat header toolbar — vertical mismatch flagged by Flo. Adding a
GetFrameHeightWithSpacing dummy at the top of the sidebar child shifts
the entire button column down to align with the first message row.

Reverted the previous TextLineHeight+4f button shrink (commit 8a78390):
buttons size was fine, only their vertical position needed correction.
This commit is contained in:
2026-05-05 23:10:16 +02:00
parent 8a78390a15
commit 11af4ce4c4
+9 -9
View File
@@ -1466,6 +1466,14 @@ public sealed class ChatLogWindow : Window
{ {
if (child) if (child)
{ {
// v1.2.0 — Top-Padding spiegelt die HeaderToolbar-Höhe der
// rechten Spalte (DrawChatHeaderToolbar wird dort als erstes
// gerendert, eine Frame-Zeile + ItemSpacing). Ohne diesen
// Padding würden die Sidebar-Buttons oben am Window-Top
// kleben, während die Messages erst unter der Toolbar
// beginnen — vertikales Mismatch.
ImGui.Dummy(new Vector2(0, ImGui.GetFrameHeightWithSpacing()));
var previousTab = Plugin.CurrentTab; var previousTab = Plugin.CurrentTab;
// Hellion Chat — auto-tell-tabs section divider rendered // Hellion Chat — auto-tell-tabs section divider rendered
// exactly once before the first temp tab, with a live unit // exactly once before the first temp tab, with a live unit
@@ -1535,21 +1543,13 @@ public sealed class ChatLogWindow : Window
: (showGreetedAffordance && tab.IsGreeted ? theme.Colors.TextDim : theme.Colors.TextPrimary); : (showGreetedAffordance && tab.IsGreeted ? theme.Colors.TextDim : theme.Colors.TextPrimary);
bool clicked; bool clicked;
// v1.2.0 Bug-Fix — Sidebar-Buttons waren sichtbar höher als das Input-Feld.
// Ursache: ImGui.GetFrameHeight() = FontSize + FramePadding.Y * 2, und unser
// HellionStyle pusht eigene FramePadding-Werte. Fix: explizit FramePadding
// (4, 2) für diesen Button überschreiben UND Höhe FramePadding-unabhängig
// aus TextLineHeight + 4f berechnen. Berechnung BEVOR FontAwesome.Push(),
// weil Icon-Glyphen größere Line-Metriken haben als der Standard-Font.
var buttonHeight = ImGui.GetTextLineHeight() + 4f;
using (ImRaii.PushStyle(ImGuiStyleVar.FramePadding, new Vector2(4f, 2f)))
using (ImRaii.PushColor(ImGuiCol.Button, 0u)) using (ImRaii.PushColor(ImGuiCol.Button, 0u))
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, ColourUtil.RgbaToAbgr(theme.Colors.SurfaceHover))) using (ImRaii.PushColor(ImGuiCol.ButtonHovered, ColourUtil.RgbaToAbgr(theme.Colors.SurfaceHover)))
using (ImRaii.PushColor(ImGuiCol.ButtonActive, ColourUtil.RgbaToAbgr(theme.Colors.Surface))) using (ImRaii.PushColor(ImGuiCol.ButtonActive, ColourUtil.RgbaToAbgr(theme.Colors.Surface)))
using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(iconColor))) using (ImRaii.PushColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(iconColor)))
using (Plugin.FontManager.FontAwesome.Push()) using (Plugin.FontManager.FontAwesome.Push())
{ {
clicked = ImGui.Button($"{icon.ToIconString()}##sidebar-tab-{tabI}", new Vector2(36f, buttonHeight)); clicked = ImGui.Button($"{icon.ToIconString()}##sidebar-tab-{tabI}", new Vector2(36f, ImGui.GetFrameHeight()));
} }
if (isCurrentTab) if (isCurrentTab)