fix(wallets): make the sort-direction toggle a circular icon button
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user