refactor(ui): semantic status text uses material tokens instead of hardcoded colors

Finishes the feedback-conventions hygiene thread: ~30 hardcoded ImVec4 green /
red / amber literals used for success / error / warning text now use
material::Success/Error/WarningVec4(), so semantic status colors follow the
active skin and stay legible in every theme (several hardcoded greens/reds read
poorly on the light/pastel skins). Covers validate-address, transaction-details,
key-export, export-all-keys, about, the Settings confirmations/lock state, and
the encryption/decryption dialogs. Brand/logo colors and muted white/grey
(disabled) text are left as-is; dynamic-alpha animated indicators are untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 08:51:10 -05:00
co-authored by Claude Opus 4.8
parent 8d8e523a26
commit f213878a7c
7 changed files with 47 additions and 47 deletions
+9 -9
View File
@@ -1547,7 +1547,7 @@ void App::renderEncryptWalletDialog() {
} }
if (!encrypt_status_.empty()) { 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(); ImGui::Spacing();
@@ -1558,7 +1558,7 @@ void App::renderEncryptWalletDialog() {
if (!valid && (encPassLen > 0 || strlen(encrypt_confirm_buf_) > 0)) { if (!valid && (encPassLen > 0 || strlen(encrypt_confirm_buf_) > 0)) {
const char* why = (encPassLen < 8) ? TR("enc_min_len") const char* why = (encPassLen < 8) ? TR("enc_min_len")
: (!encMatch ? TR("enc_mismatch") : ""); : (!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; float btnW = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
@@ -1642,7 +1642,7 @@ void App::renderEncryptWalletDialog() {
ImGui::PopItemWidth(); ImGui::PopItemWidth();
if (!enc_dlg_pin_status_.empty()) { 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(); ImGui::Spacing();
@@ -1760,7 +1760,7 @@ void App::renderEncryptWalletDialog() {
ImGui::PopItemWidth(); ImGui::PopItemWidth();
if (!encrypt_status_.empty()) { 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(); ImGui::Spacing();
@@ -1841,7 +1841,7 @@ void App::renderDecryptWalletDialog() {
ImGui::PopItemWidth(); ImGui::PopItemWidth();
if (!decryptState.status.empty()) { 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(); ImGui::Spacing();
@@ -2089,7 +2089,7 @@ void App::renderDecryptWalletDialog() {
if (services::WalletSecurityWorkflow::stepIsComplete(decryptState.step, if (services::WalletSecurityWorkflow::stepIsComplete(decryptState.step,
services::WalletSecurityWorkflow::stepFromIndex(i))) { services::WalletSecurityWorkflow::stepFromIndex(i))) {
// Completed // 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)) { } else if (i == services::WalletSecurityWorkflow::stepIndex(decryptState.step)) {
// In progress - animate // In progress - animate
float alpha = 0.5f + 0.5f * sinf((float)ImGui::GetTime() * 4.0f); float alpha = 0.5f + 0.5f * sinf((float)ImGui::GetTime() * 4.0f);
@@ -2248,7 +2248,7 @@ void App::renderPinDialogs() {
ImGui::PopItemWidth(); ImGui::PopItemWidth();
if (!pin_status_.empty()) { 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(); ImGui::Spacing();
@@ -2378,7 +2378,7 @@ void App::renderPinDialogs() {
ImGui::PopItemWidth(); ImGui::PopItemWidth();
if (!pin_status_.empty()) { 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(); ImGui::Spacing();
@@ -2447,7 +2447,7 @@ void App::renderPinDialogs() {
ImGui::PopItemWidth(); ImGui::PopItemWidth();
if (!pin_status_.empty()) { 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(); ImGui::Spacing();
+20 -20
View File
@@ -869,7 +869,7 @@ void RenderSettingsPage(App* app) {
if (skin.bundled) continue; if (skin.bundled) continue;
bool is_selected = (skin.id == skinMgr.activeSkinId()); bool is_selected = (skin.id == skinMgr.activeSkinId());
if (!skin.valid) { 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); ImGui::BeginDisabled(true);
std::string lbl = skin.name + TR("grpa_invalid_suffix"); std::string lbl = skin.name + TR("grpa_invalid_suffix");
ImGui::Selectable(lbl.c_str(), false); ImGui::Selectable(lbl.c_str(), false);
@@ -1649,20 +1649,20 @@ void RenderSettingsPage(App* app) {
ImGui::SameLine(0, Layout::spacingMd()); ImGui::SameLine(0, Layout::spacingMd());
if (isLocked) { if (isLocked) {
ImGui::PushFont(Type().iconSmall()); 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::PopFont();
ImGui::SameLine(0, Layout::spacingXs()); 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 { } else {
if (TactileButton(TR("settings_lock_now"), ImVec2(secBtnW, 0), S.resolveFont("button"))) if (TactileButton(TR("settings_lock_now"), ImVec2(secBtnW, 0), S.resolveFont("button")))
app->lockWallet(); app->lockWallet();
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_lock")); if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_lock"));
ImGui::SameLine(0, Layout::spacingSm()); ImGui::SameLine(0, Layout::spacingSm());
ImGui::PushFont(Type().iconSmall()); 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::PopFont();
ImGui::SameLine(0, Layout::spacingXs()); 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 // Remove Encryption button — trails the row, or wraps below
// when the column is too narrow for three buttons + status. // when the column is too narrow for three buttons + status.
@@ -1756,10 +1756,10 @@ void RenderSettingsPage(App* app) {
} }
} else { } else {
ImGui::PushFont(Type().iconSmall()); 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::PopFont();
ImGui::SameLine(0, Layout::spacingXs()); 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 { } else {
@@ -2989,7 +2989,7 @@ void RenderSettingsPage(App* app) {
s_settingsState.stratum_allowip, sizeof(s_settingsState.stratum_allowip))) s_settingsState.stratum_allowip, sizeof(s_settingsState.stratum_allowip)))
saveSettingsPageState(app->settings()); saveSettingsPageState(app->settings());
if (s_settingsState.stratum_allowip[0] != '\0') 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")); TR("stratum_expose_warn"));
} }
} }
@@ -3325,12 +3325,12 @@ void RenderSettingsPage(App* app) {
// Confirmation dialog for deleting blockchain data // Confirmation dialog for deleting blockchain data
if (s_settingsState.confirm_delete_blockchain) { if (s_settingsState.confirm_delete_blockchain) {
if (BeginOverlayDialog(TR("confirm_delete_blockchain_title"), &s_settingsState.confirm_delete_blockchain, 500.0f, 0.94f)) { 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::Spacing();
ImGui::TextWrapped("%s", TR("confirm_delete_blockchain_msg")); ImGui::TextWrapped("%s", TR("confirm_delete_blockchain_msg"));
ImGui::Spacing(); 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::Spacing();
ImGui::Separator(); ImGui::Separator();
ImGui::Spacing(); ImGui::Spacing();
@@ -3372,7 +3372,7 @@ void RenderSettingsPage(App* app) {
} }
if (BeginOverlayDialog(TR("confirm_rescan_title"), &s_settingsState.confirm_rescan, 500.0f, 0.94f)) { 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(); ImGui::Spacing();
@@ -3391,14 +3391,14 @@ void RenderSettingsPage(App* app) {
} else { } else {
if (s_settingsState.rescan_probe_failed) { if (s_settingsState.rescan_probe_failed) {
// A long line: TextColored does not wrap, so colour a wrapped one. // 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::TextWrapped("%s", TR("rescan_probe_failed"));
ImGui::PopStyleColor(); ImGui::PopStyleColor();
ImGui::Spacing(); ImGui::Spacing();
} }
ImGui::TextWrapped("%s", TR("confirm_rescan_msg")); ImGui::TextWrapped("%s", TR("confirm_rescan_msg"));
ImGui::Spacing(); 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(); ImGui::Spacing();
@@ -3427,12 +3427,12 @@ void RenderSettingsPage(App* app) {
// Confirm: repair wallet (-zapwallettxes=2 — wipe & rebuild wallet tx records, then rescan) // Confirm: repair wallet (-zapwallettxes=2 — wipe & rebuild wallet tx records, then rescan)
if (s_settingsState.confirm_repair_wallet) { if (s_settingsState.confirm_repair_wallet) {
if (BeginOverlayDialog(TR("confirm_repair_wallet_title"), &s_settingsState.confirm_repair_wallet, 500.0f, 0.94f)) { 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::Spacing();
ImGui::TextWrapped("%s", TR("confirm_repair_wallet_msg")); ImGui::TextWrapped("%s", TR("confirm_repair_wallet_msg"));
ImGui::Spacing(); 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::Spacing();
ImGui::Separator(); ImGui::Separator();
ImGui::Spacing(); ImGui::Spacing();
@@ -3455,12 +3455,12 @@ void RenderSettingsPage(App* app) {
// Confirm: reinstall the bundled daemon binary (stop → overwrite → restart) // Confirm: reinstall the bundled daemon binary (stop → overwrite → restart)
if (s_settingsState.confirm_reinstall_daemon) { if (s_settingsState.confirm_reinstall_daemon) {
if (BeginOverlayDialog(TR("confirm_reinstall_daemon_title"), &s_settingsState.confirm_reinstall_daemon, 500.0f, 0.94f)) { 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::Spacing();
ImGui::TextWrapped("%s", TR("confirm_reinstall_daemon_msg")); ImGui::TextWrapped("%s", TR("confirm_reinstall_daemon_msg"));
ImGui::Spacing(); 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::Spacing();
ImGui::Separator(); ImGui::Separator();
ImGui::Spacing(); ImGui::Spacing();
@@ -3484,7 +3484,7 @@ void RenderSettingsPage(App* app) {
// Confirm: restart daemon (briefly drops the connection to apply changed options) // Confirm: restart daemon (briefly drops the connection to apply changed options)
if (s_settingsState.confirm_restart_daemon) { if (s_settingsState.confirm_restart_daemon) {
if (BeginOverlayDialog(TR("confirm_restart_daemon_title"), &s_settingsState.confirm_restart_daemon, 500.0f, 0.94f)) { 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::Spacing();
ImGui::TextWrapped("%s", TR("confirm_restart_daemon_msg")); 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) // Confirm: lite wallet re-download blocks (rescan from the lite server — long but safe)
if (s_settingsState.confirm_lite_redownload) { if (s_settingsState.confirm_lite_redownload) {
if (BeginOverlayDialog(TR("confirm_lite_redownload_title"), &s_settingsState.confirm_lite_redownload, 500.0f, 0.94f)) { 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::Spacing();
ImGui::TextWrapped("%s", TR("confirm_lite_redownload_msg")); ImGui::TextWrapped("%s", TR("confirm_lite_redownload_msg"));
ImGui::Spacing(); 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::Spacing();
ImGui::Separator(); ImGui::Separator();
ImGui::Spacing(); ImGui::Spacing();
+2 -2
View File
@@ -77,7 +77,7 @@ void RenderAboutDialog(App* app, bool* p_open)
#ifdef DRAGONX_DEBUG #ifdef DRAGONX_DEBUG
ImGui::Text("%s", TR("about_build_type")); ImGui::Text("%s", TR("about_build_type"));
ImGui::SameLine(valX); 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 #else
ImGui::Text("%s", TR("about_build_type")); ImGui::Text("%s", TR("about_build_type"));
ImGui::SameLine(valX); ImGui::SameLine(valX);
@@ -92,7 +92,7 @@ void RenderAboutDialog(App* app, bool* p_open)
ImGui::Text("%s", TR("about_daemon")); ImGui::Text("%s", TR("about_daemon"));
ImGui::SameLine(valX); 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(); const auto& state = app->getWalletState();
ImGui::Text("%s", TR("about_chain")); ImGui::Text("%s", TR("about_chain"));
+1 -1
View File
@@ -117,7 +117,7 @@ void ExportAllKeysDialog::render(App* app)
} else if (!s_status.empty()) { } else if (!s_status.empty()) {
ImGui::Spacing(); ImGui::Spacing();
ImGui::PushTextWrapPos(0.0f); 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(); ImGui::PopTextWrapPos();
} }
+2 -2
View File
@@ -123,7 +123,7 @@ void KeyExportDialog::render(App* app)
if (s_fetching) { if (s_fetching) {
ImGui::TextColored(material::WarningVec4(), "%s%s", TR("key_export_fetching_base"), material::LoadingDots()); ImGui::TextColored(material::WarningVec4(), "%s%s", TR("key_export_fetching_base"), material::LoadingDots());
} else if (!s_error.empty()) { } 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. // Not a dead-end: clearing the error falls back through to the Reveal button next frame.
ImGui::Spacing(); ImGui::Spacing();
if (material::TactileButton(TR("retry"), ImVec2(revealBtn.width, 0), S.resolveFont(revealBtn.font))) { 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) { } else if (s_key.empty() && s_address.length() < 26) {
// Guard against an empty/blatantly-malformed address before dispatching a doomed reveal. // 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.) // (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()) { } else if (s_key.empty() && app->getWalletState().isLocked()) {
// Reveal would just fail with a locked-wallet RPC error — say so and offer to unlock. // Reveal would just fail with a locked-wallet RPC error — say so and offer to unlock.
ImGui::PushStyleColor(ImGuiCol_Text, material::Warning()); ImGui::PushStyleColor(ImGuiCol_Text, material::Warning());
@@ -58,16 +58,16 @@ void TransactionDetailsDialog::render(App* app)
ImVec4 type_color; ImVec4 type_color;
std::string type_display; std::string type_display;
if (tx.type == "receive") { if (tx.type == "receive") {
type_color = ImVec4(0.3f, 0.8f, 0.3f, 1.0f); type_color = material::SuccessVec4();
type_display = TR("tx_received"); type_display = TR("tx_received");
} else if (tx.type == "send") { } 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"); type_display = TR("tx_sent");
} else if (tx.type == "generate" || tx.type == "mined") { } else if (tx.type == "generate" || tx.type == "mined") {
type_color = ImVec4(0.3f, 0.6f, 0.9f, 1.0f); type_color = ImVec4(0.3f, 0.6f, 0.9f, 1.0f);
type_display = TR("tx_mined"); type_display = TR("tx_mined");
} else if (tx.type == "immature") { } 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"); type_display = TR("tx_immature");
} else { } else {
type_color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f); type_color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f);
@@ -79,11 +79,11 @@ void TransactionDetailsDialog::render(App* app)
// Confirmations badge // Confirmations badge
if (tx.confirmations == 0) { 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) { } 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 { } 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(); ImGui::Spacing();
@@ -94,9 +94,9 @@ void TransactionDetailsDialog::render(App* app)
ImGui::Text("%s", TR("amount_label")); ImGui::Text("%s", TR("amount_label"));
ImGui::SameLine(lbl.position); ImGui::SameLine(lbl.position);
if (tx.amount >= 0) { 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 { } 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 // USD equivalent if price available
+5 -5
View File
@@ -183,7 +183,7 @@ void ValidateAddressDialog::render(App* app)
if (s_validating) { if (s_validating) {
ImGui::SameLine(); 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(); ImGui::Spacing();
@@ -194,15 +194,15 @@ void ValidateAddressDialog::render(App* app)
ImGui::Spacing(); ImGui::Spacing();
if (!s_error_message.empty()) { 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 { } else {
// Valid/Invalid indicator // Valid/Invalid indicator
ImGui::Text("%s", TR("validate_status")); ImGui::Text("%s", TR("validate_status"));
ImGui::SameLine(lbl.position); ImGui::SameLine(lbl.position);
if (s_is_valid) { 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 { } 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) { if (s_is_valid) {
@@ -219,7 +219,7 @@ void ValidateAddressDialog::render(App* app)
ImGui::TextDisabled("%s", TR(app->isLiteBuild() ? "validate_ownership_unknown_lite" ImGui::TextDisabled("%s", TR(app->isLiteBuild() ? "validate_ownership_unknown_lite"
: "validate_ownership_unknown_offline")); : "validate_ownership_unknown_offline"));
} else if (s_is_mine) { } 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 { } else {
ImGui::TextDisabled("%s", TR("validate_not_mine")); ImGui::TextDisabled("%s", TR("validate_not_mine"));
} }