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:
@@ -120,8 +120,10 @@ void QRPopupDialog::render(App* app)
|
||||
widgets::AddressCopyField("##QRAddress", s_address);
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
// Buttons — size each to its label (so "Copy address" never clips), then center the pair.
|
||||
|
||||
// Footer — a primary "Copy address" + "Close" pair, placed via the shared design-system helper.
|
||||
// Size both buttons to the wider label (so "Copy address" never clips) and hand that width to
|
||||
// DialogActionFooter, which centers the pair.
|
||||
ImFont* btnFont = S.resolveFont(actionBtn.font);
|
||||
ImGui::PushFont(btnFont);
|
||||
const float btnPad = ImGui::GetStyle().FramePadding.x * 2.0f + 24.0f;
|
||||
@@ -130,14 +132,14 @@ void QRPopupDialog::render(App* app)
|
||||
ImGui::PopFont();
|
||||
if (w_copy < actionBtn.width) w_copy = actionBtn.width;
|
||||
if (w_close < actionBtn.width) w_close = actionBtn.width;
|
||||
const float total_width = w_copy + w_close + ImGui::GetStyle().ItemSpacing.x;
|
||||
ImGui::SetCursorPosX((window_width - total_width) / 2.0f);
|
||||
const float btnW = (w_copy > w_close ? w_copy : w_close);
|
||||
|
||||
if (material::TactileButton(TR("copy_address"), ImVec2(w_copy, 0), btnFont)) {
|
||||
bool doCopy = false, doClose = false;
|
||||
material::DialogActionFooter(TR("copy_address"), true, TR("close"), doCopy, doClose, btnW);
|
||||
if (doCopy) {
|
||||
ImGui::SetClipboardText(s_address.c_str());
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (material::TactileButton(TR("close"), ImVec2(w_close, 0), btnFont)) {
|
||||
if (doClose) {
|
||||
close();
|
||||
}
|
||||
material::EndOverlayDialog();
|
||||
|
||||
Reference in New Issue
Block a user