refactor(settings): unify the viewing-key care header with the private-key one

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) <noreply@anthropic.com>
This commit is contained in:
2026-07-13 20:37:51 -05:00
parent a13190a6df
commit 6ecbf835ec

View File

@@ -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.