diff --git a/HellionChat/Ui/Components/Sidebar.cs b/HellionChat/Ui/Components/Sidebar.cs index d30e197..3b43f24 100644 --- a/HellionChat/Ui/Components/Sidebar.cs +++ b/HellionChat/Ui/Components/Sidebar.cs @@ -269,7 +269,6 @@ internal sealed class Sidebar } ImGui.InvisibleButton("row", new Vector2(tabHitWidth, RowHeight)); - var rowHovered = ImGui.IsItemHovered(); if (ImGui.IsItemClicked()) { var previous = activeTab; @@ -350,23 +349,23 @@ internal sealed class Sidebar TabContextMenu.Draw(tab, "ctx", _pool); - var popHovered = false; if (hasPopOut) { ImGui.SameLine(0f, 0f); - ImGui.InvisibleButton("popout", new Vector2(PopOutHitWidth, RowHeight)); - popHovered = ImGui.IsItemHovered(); - if (ImGui.IsItemClicked()) - _pool.TryOpen(tab); - } - if (hasPopOut && (rowHovered || popHovered)) - { - using (_fonts.FontAwesome.Push()) - { - var glyph = FontAwesomeIcon.ArrowUpRightFromSquare.ToIconString(); - dl.AddText(origin + new Vector2(avail - PopOutHitWidth + 4f, 8f), mutedAbgr, glyph); - } + // Glyph follows the row surface, not the button's own hover: the + // button sits inside the row, and the old pairing needed a hover + // state one line before it existed. + var (popClicked, _) = IconButton.Draw( + ImGui.GetID("popout"u8), + new Vector2(PopOutHitWidth, RowHeight), + surfaceHovered ? FontAwesomeIcon.ArrowUpRightFromSquare : null, + mutedAbgr, + _palette.Abgr(Token.SurfaceHover, colors), + _fonts.FontAwesome + ); + if (popClicked) + _pool.TryOpen(tab); } if (showGreeted) @@ -376,16 +375,23 @@ internal sealed class Sidebar // between the row button and the popup call would steal the // right-click trigger (B3-1 ordering constraint). ImGui.SetCursorScreenPos(origin); - ImGui.InvisibleButton("greeted", new Vector2(GreetedHitWidth, RowHeight)); - if (ImGui.IsItemClicked()) - ToggleGreetedForSelfTest(tab); // CheckCircle = greeted, plain Check = still pending (1.5.6 mapping). var greetedGlyph = Plugin.Instance.AutoTellTabsService.IsGreeted(tab) ? FontAwesomeIcon.CheckCircle : FontAwesomeIcon.Check; - using (_fonts.FontAwesome.Push()) - dl.AddText(origin + new Vector2(4f, 8f), mutedAbgr, greetedGlyph.ToIconString()); + + var (greetedClicked, _) = IconButton.Draw( + ImGui.GetID("greeted"u8), + new Vector2(GreetedHitWidth, RowHeight), + greetedGlyph, + mutedAbgr, + _palette.Abgr(Token.SurfaceHover, colors), + _fonts.FontAwesome + ); + if (greetedClicked) + ToggleGreetedForSelfTest(tab); + LastRenderedGreetedGlyphCount++; }