refactor(ui): consolidate dialog footers + shared empty-state, unify buttons/rounding
Addresses the cross-screen inconsistencies from the layout audit by routing screens onto the design system's own (previously under-used) shared helpers: - Dialog footers: migrate ~9 overlay dialogs off hand-rolled placement onto the shared helpers — DialogActionFooter (primary+Close), DialogConfirmFooter, or BeginOverlayDialogFooter for custom/multi-button rows — so footers share one centered treatment. All footer/action buttons now use TactileButton (glass press) instead of the bare StyledButton some dialogs used. - Empty states: add a shared material::DrawEmptyState(icon, title, hint) (centered icon + title + wrapped hint) and adopt it in Peers, Transactions, and Market-portfolio, which previously showed a bare left-aligned caption. - Security dialogs: add the missing Cancel to Change Passphrase and Set PIN so the whole security family shares a two-button footer (Cancel dismisses without applying). - Transactions pager: shared TactileButton helpers (matching Explorer). - Frosted-pane rounding: Contacts/Chat use Layout::glassRounding() instead of hardcoded 12/10/8px literals, matching Peers. - "Set Label..." title loses its stray trailing ellipsis. Preserves every button's label and action; the transfer footer's order becomes [Confirm][Cancel] to match the shared helper's primary-first convention. Verified at 1280 across full-node + Lite + Windows (ctest green) and an adversarial diff review (clean). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -224,6 +224,10 @@ void RequestPaymentDialog::render(App* app)
|
||||
if (w_uri < actionBtn.width) w_uri = actionBtn.width;
|
||||
if (w_addr < actionBtn.width) w_addr = actionBtn.width;
|
||||
|
||||
// Center the two-button copy row via the shared helper (no extra divider; the Separator
|
||||
// above already frames this region). Total = both button widths + the ItemSpacing between.
|
||||
material::BeginOverlayDialogFooter(w_uri + w_addr + ImGui::GetStyle().ItemSpacing.x, false);
|
||||
|
||||
// Copy URI button
|
||||
if (material::TactileButton(TR("request_copy_uri"), ImVec2(w_uri, 0), btnFont)) {
|
||||
ImGui::SetClipboardText(s_payment_uri.c_str());
|
||||
@@ -248,6 +252,9 @@ void RequestPaymentDialog::render(App* app)
|
||||
float w_close = ImGui::CalcTextSize(TR("close")).x + btnPad;
|
||||
ImGui::PopFont();
|
||||
if (w_close < actionBtn.width) w_close = actionBtn.width;
|
||||
// Center the lone Close button via the shared helper (no extra divider — matches the
|
||||
// existing tight spacing above it).
|
||||
material::BeginOverlayDialogFooter(w_close, false);
|
||||
if (material::TactileButton(TR("close"), ImVec2(w_close, 0), btnFont)) {
|
||||
s_open = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user