From 6ecbf835ece21895420b6303318d2d7a369afed6 Mon Sep 17 00:00:00 2001 From: DanS Date: Mon, 13 Jul 2026 20:37:51 -0500 Subject: [PATCH] refactor(settings): unify the viewing-key care header with the private-key one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Settle the key-import reference before propagating its design to the other settings modals: the viewing-key import now uses the same DialogWarningHeader (⚠ warning icon + Warning color) as the private-key import, instead of the milder grey eye + grey note. The viewing-key note is longer, so that mode gets a wider card (760 vs 640) to keep it on one line. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/app.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index d8922ce..bc82151 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -2848,7 +2848,9 @@ void App::renderImportKeyDialog() ov.title = viewMode ? TR("import_viewkey_title") : TR("import_key_title"); ov.p_open = &show_import_key_; ov.style = m::OverlayStyle::BlurFloat; - ov.cardWidth = 640.0f; // wide enough that the one-line warning under the heading doesn't wrap + // Wide enough that the one-line care header under the heading doesn't wrap; the viewing-key note + // is longer, so that mode gets a wider card. + ov.cardWidth = viewMode ? 760.0f : 640.0f; ov.idSuffix = "importkey"; if (!m::BeginOverlayDialog(ov)) return; @@ -2878,19 +2880,9 @@ void App::renderImportKeyDialog() // Esc dismisses (this overlay has no built-in Esc handling). if (ImGui::IsKeyPressed(ImGuiKey_Escape)) show_import_key_ = false; - // Handle-with-care note. A spending key grants access to funds (strong warning); a viewing key - // is watch-only (milder, informational eye note). - if (viewMode) { - ImGui::PushFont(m::Type().iconSmall()); - ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(m::OnSurfaceMedium()), ICON_MD_VISIBILITY); - ImGui::PopFont(); - ImGui::SameLine(0, 6.0f * dp); - ImGui::PushTextWrapPos(0.0f); - ImGui::TextColored(ImGui::ColorConvertU32ToFloat4(m::OnSurfaceMedium()), "%s", TR("import_viewkey_note")); - ImGui::PopTextWrapPos(); - } else { - m::DialogWarningHeader(TR("import_key_warn")); - } + // Handle-with-care header — same warning icon + color for both modes (the viewing dialog is wider + // so its longer watch-only note stays on one line, matching the private-key warning). + m::DialogWarningHeader(viewMode ? TR("import_viewkey_note") : TR("import_key_warn")); ImGui::Spacing(); // A running node is required — say so up front instead of failing only after Import.