feat(receive): migrate QR + Request-payment modals to the reference design

Bring the two Receive-tab modals onto the settings-modal reference language
(presentation-only):
- struct-form BeginOverlayDialog(OverlayDialogSpec{BlurFloat, cardWidth, idSuffix})
  replacing the legacy positional overload (idSuffix qrpopup / requestpay)
- StyledButton -> TactileButton (2 + 3 sites)
- drop Request-payment's description divider

No logic touched: the QR texture lifecycle, payment-URI builder, address combo,
and clipboard/notification calls are unchanged. The "DRGX" ticker stays hardcoded
per the existing codebase convention (7 sites, no currency TR key).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 16:20:02 -05:00
parent b6b4fdacb5
commit 04a5078133
2 changed files with 17 additions and 11 deletions

View File

@@ -67,7 +67,11 @@ void QRPopupDialog::render(App* app)
// Match the key-export modal: 85% of the window width (divide out the dpiScale that // Match the key-export modal: 85% of the window width (divide out the dpiScale that
// BeginOverlayDialog re-applies, so the final card is exactly 85% at any font scale). // BeginOverlayDialog re-applies, so the final card is exactly 85% at any font scale).
const float cardW = (0.85f * ImGui::GetMainViewport()->Size.x) / Layout::dpiScale(); const float cardW = (0.85f * ImGui::GetMainViewport()->Size.x) / Layout::dpiScale();
if (material::BeginOverlayDialog(TR("qr_title"), &s_open, cardW, 0.94f)) { material::OverlayDialogSpec ov;
ov.title = TR("qr_title"); ov.p_open = &s_open;
ov.style = material::OverlayStyle::BlurFloat;
ov.cardWidth = cardW; ov.idSuffix = "qrpopup";
if (material::BeginOverlayDialog(ov)) {
// Label if present // Label if present
if (!s_label.empty()) { if (!s_label.empty()) {
@@ -120,11 +124,11 @@ void QRPopupDialog::render(App* app)
const float total_width = w_copy + w_close + ImGui::GetStyle().ItemSpacing.x; const float total_width = w_copy + w_close + ImGui::GetStyle().ItemSpacing.x;
ImGui::SetCursorPosX((window_width - total_width) / 2.0f); ImGui::SetCursorPosX((window_width - total_width) / 2.0f);
if (material::StyledButton(TR("copy_address"), ImVec2(w_copy, 0), btnFont)) { if (material::TactileButton(TR("copy_address"), ImVec2(w_copy, 0), btnFont)) {
ImGui::SetClipboardText(s_address.c_str()); ImGui::SetClipboardText(s_address.c_str());
} }
ImGui::SameLine(); ImGui::SameLine();
if (material::StyledButton(TR("close"), ImVec2(w_close, 0), btnFont)) { if (material::TactileButton(TR("close"), ImVec2(w_close, 0), btnFont)) {
close(); close();
} }
material::EndOverlayDialog(); material::EndOverlayDialog();

View File

@@ -76,13 +76,15 @@ void RequestPaymentDialog::render(App* app)
auto qr = S.drawElement("dialogs.request-payment", "qr-code"); auto qr = S.drawElement("dialogs.request-payment", "qr-code");
auto actionBtn = S.button("dialogs.request-payment", "action-button"); auto actionBtn = S.button("dialogs.request-payment", "action-button");
if (material::BeginOverlayDialog(TR("request_title"), &s_open, win.width, 0.94f)) { material::OverlayDialogSpec ov;
ov.title = TR("request_title"); ov.p_open = &s_open;
ov.style = material::OverlayStyle::BlurFloat;
ov.cardWidth = win.width; ov.idSuffix = "requestpay";
if (material::BeginOverlayDialog(ov)) {
const auto& state = app->getWalletState(); const auto& state = app->getWalletState();
ImGui::TextWrapped("%s", TR("request_description")); ImGui::TextWrapped("%s", TR("request_description"));
ImGui::Spacing();
ImGui::Separator();
ImGui::Spacing(); ImGui::Spacing();
// Address selection // Address selection
@@ -196,14 +198,14 @@ void RequestPaymentDialog::render(App* app)
ImGui::Spacing(); ImGui::Spacing();
// Copy button // Copy button
if (material::StyledButton(TR("request_copy_uri"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) { if (material::TactileButton(TR("request_copy_uri"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) {
ImGui::SetClipboardText(s_payment_uri.c_str()); ImGui::SetClipboardText(s_payment_uri.c_str());
Notifications::instance().success(TR("request_uri_copied")); Notifications::instance().success(TR("request_uri_copied"));
} }
ImGui::SameLine(); ImGui::SameLine();
if (material::StyledButton(TR("copy_address"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) { if (material::TactileButton(TR("copy_address"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) {
ImGui::SetClipboardText(s_address); ImGui::SetClipboardText(s_address);
Notifications::instance().success(TR("address_copied")); Notifications::instance().success(TR("address_copied"));
} }
@@ -212,7 +214,7 @@ void RequestPaymentDialog::render(App* app)
ImGui::Spacing(); ImGui::Spacing();
// Close button // Close button
if (material::StyledButton(TR("close"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) { if (material::TactileButton(TR("close"), ImVec2(actionBtn.width, 0), S.resolveFont(actionBtn.font))) {
s_open = false; s_open = false;
} }
material::EndOverlayDialog(); material::EndOverlayDialog();