From 3dc4d2d8608bd28a5e2b1bcafb86f8ba7f170535 Mon Sep 17 00:00:00 2001 From: DanS Date: Sat, 11 Jul 2026 17:26:59 -0500 Subject: [PATCH] fix(wallets): make the sort-direction toggle a circular icon button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swap the rounded-rect StyledButton for material::IconButton (square size → bgRounding = radius, so a circle) with the arrow glyph mathematically centered; carries its own hover fill + asc/desc tooltip. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/ui/windows/wallets_dialog.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ui/windows/wallets_dialog.h b/src/ui/windows/wallets_dialog.h index 02c0e13..b04cf38 100644 --- a/src/ui/windows/wallets_dialog.h +++ b/src/ui/windows/wallets_dialog.h @@ -138,13 +138,18 @@ public: segLabels, 4, s_sortMode, segFont, "##walletSortSeg", dp); if (clk >= 0) s_sortMode = clk; // SegmentedControl is draw-list based and doesn't move the layout cursor, so place the - // direction arrow explicitly just to its right on the same baseline (a real item advances - // the cursor past this row for the list below). + // direction toggle explicitly just to its right on the same baseline (a real item advances + // the cursor past this row for the list below). A circular IconButton (square size → + // bgRounding = radius) with the arrow glyph centered. ImGui::SetCursorScreenPos(ImVec2(segOrigin.x + segTW + Layout::spacingSm(), segOrigin.y)); - if (StyledButton(s_sortDesc ? ICON_MD_ARROW_DOWNWARD : ICON_MD_ARROW_UPWARD, - ImVec2(segH, segH), Type().iconSmall())) + IconButtonStyle dirStyle; + dirStyle.restBg = WithAlpha(OnSurface(), 24); + dirStyle.hoverBg = WithAlpha(OnSurface(), 44); + dirStyle.color = OnSurfaceMedium(); + dirStyle.tooltip = TR(s_sortDesc ? "wallets_sort_desc" : "wallets_sort_asc"); + if (IconButton("##walletSortDir", s_sortDesc ? ICON_MD_ARROW_DOWNWARD : ICON_MD_ARROW_UPWARD, + Type().iconSmall(), ImVec2(segH, segH), dirStyle)) s_sortDesc = !s_sortDesc; - if (ImGui::IsItemHovered()) Tooltip("%s", TR(s_sortDesc ? "wallets_sort_desc" : "wallets_sort_asc")); } ImGui::Dummy(ImVec2(0, Layout::spacingSm()));