diff --git a/src/app_security.cpp b/src/app_security.cpp index 959baf3..ee3c45e 100644 --- a/src/app_security.cpp +++ b/src/app_security.cpp @@ -1547,7 +1547,7 @@ void App::renderEncryptWalletDialog() { } if (!encrypt_status_.empty()) { - ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "%s", encrypt_status_.c_str()); + ImGui::TextColored(ui::material::WarningVec4(), "%s", encrypt_status_.c_str()); } ImGui::Spacing(); @@ -1558,7 +1558,7 @@ void App::renderEncryptWalletDialog() { if (!valid && (encPassLen > 0 || strlen(encrypt_confirm_buf_) > 0)) { const char* why = (encPassLen < 8) ? TR("enc_min_len") : (!encMatch ? TR("enc_mismatch") : ""); - if (*why) ImGui::TextColored(ImVec4(1.0f, 0.7f, 0.3f, 1.0f), "%s", why); + if (*why) ImGui::TextColored(ui::material::WarningVec4(), "%s", why); } float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f; @@ -1642,7 +1642,7 @@ void App::renderEncryptWalletDialog() { ImGui::PopItemWidth(); if (!enc_dlg_pin_status_.empty()) { - ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "%s", enc_dlg_pin_status_.c_str()); + ImGui::TextColored(ui::material::WarningVec4(), "%s", enc_dlg_pin_status_.c_str()); } ImGui::Spacing(); @@ -1760,7 +1760,7 @@ void App::renderEncryptWalletDialog() { ImGui::PopItemWidth(); if (!encrypt_status_.empty()) { - ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "%s", encrypt_status_.c_str()); + ImGui::TextColored(ui::material::WarningVec4(), "%s", encrypt_status_.c_str()); } ImGui::Spacing(); @@ -1841,7 +1841,7 @@ void App::renderDecryptWalletDialog() { ImGui::PopItemWidth(); if (!decryptState.status.empty()) { - ImGui::TextColored(ImVec4(1, 0.4f, 0.4f, 1), "%s", decryptState.status.c_str()); + ImGui::TextColored(ui::material::ErrorVec4(), "%s", decryptState.status.c_str()); } ImGui::Spacing(); @@ -2089,7 +2089,7 @@ void App::renderDecryptWalletDialog() { if (services::WalletSecurityWorkflow::stepIsComplete(decryptState.step, services::WalletSecurityWorkflow::stepFromIndex(i))) { // Completed - ImGui::TextColored(ImVec4(0.3f, 0.9f, 0.4f, 1.0f), ICON_MD_CHECK_CIRCLE); + ImGui::TextColored(ui::material::SuccessVec4(), ICON_MD_CHECK_CIRCLE); } else if (i == services::WalletSecurityWorkflow::stepIndex(decryptState.step)) { // In progress - animate float alpha = 0.5f + 0.5f * sinf((float)ImGui::GetTime() * 4.0f); @@ -2248,7 +2248,7 @@ void App::renderPinDialogs() { ImGui::PopItemWidth(); if (!pin_status_.empty()) { - ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "%s", pin_status_.c_str()); + ImGui::TextColored(ui::material::WarningVec4(), "%s", pin_status_.c_str()); } ImGui::Spacing(); @@ -2378,7 +2378,7 @@ void App::renderPinDialogs() { ImGui::PopItemWidth(); if (!pin_status_.empty()) { - ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "%s", pin_status_.c_str()); + ImGui::TextColored(ui::material::WarningVec4(), "%s", pin_status_.c_str()); } ImGui::Spacing(); @@ -2447,7 +2447,7 @@ void App::renderPinDialogs() { ImGui::PopItemWidth(); if (!pin_status_.empty()) { - ImGui::TextColored(ImVec4(1, 0.7f, 0, 1), "%s", pin_status_.c_str()); + ImGui::TextColored(ui::material::WarningVec4(), "%s", pin_status_.c_str()); } ImGui::Spacing(); diff --git a/src/ui/pages/settings_page.cpp b/src/ui/pages/settings_page.cpp index a830bcc..3da9a67 100644 --- a/src/ui/pages/settings_page.cpp +++ b/src/ui/pages/settings_page.cpp @@ -869,7 +869,7 @@ void RenderSettingsPage(App* app) { if (skin.bundled) continue; bool is_selected = (skin.id == skinMgr.activeSkinId()); if (!skin.valid) { - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.3f, 0.3f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Text, material::ErrorVec4()); ImGui::BeginDisabled(true); std::string lbl = skin.name + TR("grpa_invalid_suffix"); ImGui::Selectable(lbl.c_str(), false); @@ -1649,20 +1649,20 @@ void RenderSettingsPage(App* app) { ImGui::SameLine(0, Layout::spacingMd()); if (isLocked) { ImGui::PushFont(Type().iconSmall()); - ImGui::TextColored(ImVec4(1,0.7f,0.3f,1.0f), ICON_MD_LOCK); + ImGui::TextColored(material::WarningVec4(), ICON_MD_LOCK); ImGui::PopFont(); ImGui::SameLine(0, Layout::spacingXs()); - ImGui::TextColored(ImVec4(1,0.7f,0.3f,1.0f), "%s", TR("settings_locked")); + ImGui::TextColored(material::WarningVec4(), "%s", TR("settings_locked")); } else { if (TactileButton(TR("settings_lock_now"), ImVec2(secBtnW, 0), S.resolveFont("button"))) app->lockWallet(); if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_lock")); ImGui::SameLine(0, Layout::spacingSm()); ImGui::PushFont(Type().iconSmall()); - ImGui::TextColored(ImVec4(0.3f,1.0f,0.5f,1.0f), ICON_MD_LOCK_OPEN); + ImGui::TextColored(material::SuccessVec4(), ICON_MD_LOCK_OPEN); ImGui::PopFont(); ImGui::SameLine(0, Layout::spacingXs()); - ImGui::TextColored(ImVec4(0.3f,1.0f,0.5f,1.0f), "%s", TR("settings_unlocked")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("settings_unlocked")); } // Remove Encryption button — trails the row, or wraps below // when the column is too narrow for three buttons + status. @@ -1756,10 +1756,10 @@ void RenderSettingsPage(App* app) { } } else { ImGui::PushFont(Type().iconSmall()); - ImGui::TextColored(ImVec4(0.3f,1.0f,0.5f,1.0f), ICON_MD_DIALPAD); + ImGui::TextColored(material::SuccessVec4(), ICON_MD_DIALPAD); ImGui::PopFont(); ImGui::SameLine(0, Layout::spacingXs()); - ImGui::TextColored(ImVec4(0.3f,1.0f,0.5f,1.0f), "%s", TR("settings_pin_active")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("settings_pin_active")); } } } else { @@ -2989,7 +2989,7 @@ void RenderSettingsPage(App* app) { s_settingsState.stratum_allowip, sizeof(s_settingsState.stratum_allowip))) saveSettingsPageState(app->settings()); if (s_settingsState.stratum_allowip[0] != '\0') - ImGui::TextColored(ImVec4(0.95f, 0.75f, 0.25f, 1.0f), " %s", + ImGui::TextColored(material::WarningVec4(), " %s", TR("stratum_expose_warn")); } } @@ -3325,12 +3325,12 @@ void RenderSettingsPage(App* app) { // Confirmation dialog for deleting blockchain data if (s_settingsState.confirm_delete_blockchain) { if (BeginOverlayDialog(TR("confirm_delete_blockchain_title"), &s_settingsState.confirm_delete_blockchain, 500.0f, 0.94f)) { - material::DialogWarningHeader(TR("warning"), ImVec4(1.0f, 0.3f, 0.3f, 1.0f)); + material::DialogWarningHeader(TR("warning"), material::ErrorVec4()); ImGui::Spacing(); ImGui::TextWrapped("%s", TR("confirm_delete_blockchain_msg")); ImGui::Spacing(); - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%s", TR("confirm_delete_blockchain_safe")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("confirm_delete_blockchain_safe")); ImGui::Spacing(); ImGui::Separator(); ImGui::Spacing(); @@ -3372,7 +3372,7 @@ void RenderSettingsPage(App* app) { } if (BeginOverlayDialog(TR("confirm_rescan_title"), &s_settingsState.confirm_rescan, 500.0f, 0.94f)) { - material::DialogWarningHeader(TR("warning"), ImVec4(1.0f, 0.8f, 0.2f, 1.0f)); + material::DialogWarningHeader(TR("warning"), material::WarningVec4()); ImGui::Spacing(); @@ -3391,14 +3391,14 @@ void RenderSettingsPage(App* app) { } else { if (s_settingsState.rescan_probe_failed) { // A long line: TextColored does not wrap, so colour a wrapped one. - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.8f, 0.2f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Text, material::WarningVec4()); ImGui::TextWrapped("%s", TR("rescan_probe_failed")); ImGui::PopStyleColor(); ImGui::Spacing(); } ImGui::TextWrapped("%s", TR("confirm_rescan_msg")); ImGui::Spacing(); - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%s", TR("confirm_rescan_safe")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("confirm_rescan_safe")); } ImGui::Spacing(); @@ -3427,12 +3427,12 @@ void RenderSettingsPage(App* app) { // Confirm: repair wallet (-zapwallettxes=2 — wipe & rebuild wallet tx records, then rescan) if (s_settingsState.confirm_repair_wallet) { if (BeginOverlayDialog(TR("confirm_repair_wallet_title"), &s_settingsState.confirm_repair_wallet, 500.0f, 0.94f)) { - material::DialogWarningHeader(TR("warning"), ImVec4(1.0f, 0.8f, 0.2f, 1.0f)); + material::DialogWarningHeader(TR("warning"), material::WarningVec4()); ImGui::Spacing(); ImGui::TextWrapped("%s", TR("confirm_repair_wallet_msg")); ImGui::Spacing(); - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%s", TR("confirm_repair_wallet_safe")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("confirm_repair_wallet_safe")); ImGui::Spacing(); ImGui::Separator(); ImGui::Spacing(); @@ -3455,12 +3455,12 @@ void RenderSettingsPage(App* app) { // Confirm: reinstall the bundled daemon binary (stop → overwrite → restart) if (s_settingsState.confirm_reinstall_daemon) { if (BeginOverlayDialog(TR("confirm_reinstall_daemon_title"), &s_settingsState.confirm_reinstall_daemon, 500.0f, 0.94f)) { - material::DialogWarningHeader(TR("warning"), ImVec4(1.0f, 0.8f, 0.2f, 1.0f)); + material::DialogWarningHeader(TR("warning"), material::WarningVec4()); ImGui::Spacing(); ImGui::TextWrapped("%s", TR("confirm_reinstall_daemon_msg")); ImGui::Spacing(); - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%s", TR("confirm_reinstall_daemon_safe")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("confirm_reinstall_daemon_safe")); ImGui::Spacing(); ImGui::Separator(); ImGui::Spacing(); @@ -3484,7 +3484,7 @@ void RenderSettingsPage(App* app) { // Confirm: restart daemon (briefly drops the connection to apply changed options) if (s_settingsState.confirm_restart_daemon) { if (BeginOverlayDialog(TR("confirm_restart_daemon_title"), &s_settingsState.confirm_restart_daemon, 500.0f, 0.94f)) { - material::DialogWarningHeader(TR("warning"), ImVec4(1.0f, 0.8f, 0.2f, 1.0f)); + material::DialogWarningHeader(TR("warning"), material::WarningVec4()); ImGui::Spacing(); ImGui::TextWrapped("%s", TR("confirm_restart_daemon_msg")); @@ -3511,12 +3511,12 @@ void RenderSettingsPage(App* app) { // Confirm: lite wallet re-download blocks (rescan from the lite server — long but safe) if (s_settingsState.confirm_lite_redownload) { if (BeginOverlayDialog(TR("confirm_lite_redownload_title"), &s_settingsState.confirm_lite_redownload, 500.0f, 0.94f)) { - material::DialogWarningHeader(TR("warning"), ImVec4(1.0f, 0.8f, 0.2f, 1.0f)); + material::DialogWarningHeader(TR("warning"), material::WarningVec4()); ImGui::Spacing(); ImGui::TextWrapped("%s", TR("confirm_lite_redownload_msg")); ImGui::Spacing(); - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%s", TR("confirm_lite_redownload_safe")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("confirm_lite_redownload_safe")); ImGui::Spacing(); ImGui::Separator(); ImGui::Spacing(); diff --git a/src/ui/windows/about_dialog.cpp b/src/ui/windows/about_dialog.cpp index 67a6611..0b48ae5 100644 --- a/src/ui/windows/about_dialog.cpp +++ b/src/ui/windows/about_dialog.cpp @@ -77,7 +77,7 @@ void RenderAboutDialog(App* app, bool* p_open) #ifdef DRAGONX_DEBUG ImGui::Text("%s", TR("about_build_type")); ImGui::SameLine(valX); - ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.0f, 1.0f), "%s", TR("about_debug")); + ImGui::TextColored(material::WarningVec4(), "%s", TR("about_debug")); #else ImGui::Text("%s", TR("about_build_type")); ImGui::SameLine(valX); @@ -92,7 +92,7 @@ void RenderAboutDialog(App* app, bool* p_open) ImGui::Text("%s", TR("about_daemon")); ImGui::SameLine(valX); - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%s", TR("connected")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("connected")); const auto& state = app->getWalletState(); ImGui::Text("%s", TR("about_chain")); diff --git a/src/ui/windows/export_all_keys_dialog.cpp b/src/ui/windows/export_all_keys_dialog.cpp index 0a9d7d5..d6d4ac3 100644 --- a/src/ui/windows/export_all_keys_dialog.cpp +++ b/src/ui/windows/export_all_keys_dialog.cpp @@ -117,7 +117,7 @@ void ExportAllKeysDialog::render(App* app) } else if (!s_status.empty()) { ImGui::Spacing(); ImGui::PushTextWrapPos(0.0f); - ImGui::TextColored(ImVec4(0.8f, 0.3f, 0.3f, 1.0f), "%s", s_status.c_str()); + ImGui::TextColored(material::ErrorVec4(), "%s", s_status.c_str()); ImGui::PopTextWrapPos(); } diff --git a/src/ui/windows/key_export_dialog.cpp b/src/ui/windows/key_export_dialog.cpp index 6809de7..f2f93fc 100644 --- a/src/ui/windows/key_export_dialog.cpp +++ b/src/ui/windows/key_export_dialog.cpp @@ -123,7 +123,7 @@ void KeyExportDialog::render(App* app) if (s_fetching) { ImGui::TextColored(material::WarningVec4(), "%s%s", TR("key_export_fetching_base"), material::LoadingDots()); } else if (!s_error.empty()) { - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), TR("error_format"), s_error.c_str()); + ImGui::TextColored(material::ErrorVec4(), TR("error_format"), s_error.c_str()); // Not a dead-end: clearing the error falls back through to the Reveal button next frame. ImGui::Spacing(); if (material::TactileButton(TR("retry"), ImVec2(revealBtn.width, 0), S.resolveFont(revealBtn.font))) { @@ -132,7 +132,7 @@ void KeyExportDialog::render(App* app) } else if (s_key.empty() && s_address.length() < 26) { // Guard against an empty/blatantly-malformed address before dispatching a doomed reveal. // (Also avoids reading s_address[0] on an empty string in the Reveal branch below.) - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "%s", TR("invalid_address")); + ImGui::TextColored(material::ErrorVec4(), "%s", TR("invalid_address")); } else if (s_key.empty() && app->getWalletState().isLocked()) { // Reveal would just fail with a locked-wallet RPC error — say so and offer to unlock. ImGui::PushStyleColor(ImGuiCol_Text, material::Warning()); diff --git a/src/ui/windows/transaction_details_dialog.cpp b/src/ui/windows/transaction_details_dialog.cpp index dbb33d3..11f331a 100644 --- a/src/ui/windows/transaction_details_dialog.cpp +++ b/src/ui/windows/transaction_details_dialog.cpp @@ -58,16 +58,16 @@ void TransactionDetailsDialog::render(App* app) ImVec4 type_color; std::string type_display; if (tx.type == "receive") { - type_color = ImVec4(0.3f, 0.8f, 0.3f, 1.0f); + type_color = material::SuccessVec4(); type_display = TR("tx_received"); } else if (tx.type == "send") { - type_color = ImVec4(0.8f, 0.3f, 0.3f, 1.0f); + type_color = material::ErrorVec4(); type_display = TR("tx_sent"); } else if (tx.type == "generate" || tx.type == "mined") { type_color = ImVec4(0.3f, 0.6f, 0.9f, 1.0f); type_display = TR("tx_mined"); } else if (tx.type == "immature") { - type_color = ImVec4(0.8f, 0.8f, 0.3f, 1.0f); + type_color = material::WarningVec4(); type_display = TR("tx_immature"); } else { type_color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f); @@ -79,11 +79,11 @@ void TransactionDetailsDialog::render(App* app) // Confirmations badge if (tx.confirmations == 0) { - ImGui::TextColored(ImVec4(0.8f, 0.6f, 0.0f, 1.0f), "%s", TR("pending")); + ImGui::TextColored(material::WarningVec4(), "%s", TR("pending")); } else if (tx.confirmations < 10) { - ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.3f, 1.0f), TR("tx_confirmations"), tx.confirmations); + ImGui::TextColored(material::WarningVec4(), TR("tx_confirmations"), tx.confirmations); } else { - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), TR("tx_confirmations"), tx.confirmations); + ImGui::TextColored(material::SuccessVec4(), TR("tx_confirmations"), tx.confirmations); } ImGui::Spacing(); @@ -94,9 +94,9 @@ void TransactionDetailsDialog::render(App* app) ImGui::Text("%s", TR("amount_label")); ImGui::SameLine(lbl.position); if (tx.amount >= 0) { - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "+%.8f DRGX", tx.amount); + ImGui::TextColored(material::SuccessVec4(), "+%.8f DRGX", tx.amount); } else { - ImGui::TextColored(ImVec4(0.8f, 0.3f, 0.3f, 1.0f), "%.8f DRGX", tx.amount); + ImGui::TextColored(material::ErrorVec4(), "%.8f DRGX", tx.amount); } // USD equivalent if price available diff --git a/src/ui/windows/validate_address_dialog.cpp b/src/ui/windows/validate_address_dialog.cpp index 07b6d91..688e0ce 100644 --- a/src/ui/windows/validate_address_dialog.cpp +++ b/src/ui/windows/validate_address_dialog.cpp @@ -183,7 +183,7 @@ void ValidateAddressDialog::render(App* app) if (s_validating) { ImGui::SameLine(); - ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "%s", TR("validating")); + ImGui::TextColored(material::WarningVec4(), "%s", TR("validating")); } ImGui::Spacing(); @@ -194,15 +194,15 @@ void ValidateAddressDialog::render(App* app) ImGui::Spacing(); if (!s_error_message.empty()) { - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), TR("error_format"), s_error_message.c_str()); + ImGui::TextColored(material::ErrorVec4(), TR("error_format"), s_error_message.c_str()); } else { // Valid/Invalid indicator ImGui::Text("%s", TR("validate_status")); ImGui::SameLine(lbl.position); if (s_is_valid) { - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%s", TR("validate_valid")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("validate_valid")); } else { - ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "%s", TR("validate_invalid")); + ImGui::TextColored(material::ErrorVec4(), "%s", TR("validate_invalid")); } if (s_is_valid) { @@ -219,7 +219,7 @@ void ValidateAddressDialog::render(App* app) ImGui::TextDisabled("%s", TR(app->isLiteBuild() ? "validate_ownership_unknown_lite" : "validate_ownership_unknown_offline")); } else if (s_is_mine) { - ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%s", TR("validate_is_mine")); + ImGui::TextColored(material::SuccessVec4(), "%s", TR("validate_is_mine")); } else { ImGui::TextDisabled("%s", TR("validate_not_mine")); }