diff --git a/src/ui/windows/transaction_details_dialog.cpp b/src/ui/windows/transaction_details_dialog.cpp index 11f331a..e17f0f3 100644 --- a/src/ui/windows/transaction_details_dialog.cpp +++ b/src/ui/windows/transaction_details_dialog.cpp @@ -64,13 +64,16 @@ void TransactionDetailsDialog::render(App* app) 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_color = material::SecondaryVec4(); // themed, not a raw literal (F033) type_display = TR("tx_mined"); } else if (tx.type == "immature") { type_color = material::WarningVec4(); type_display = TR("tx_immature"); + } else if (tx.type == "shield") { + type_color = ImGui::ColorConvertU32ToFloat4(material::Primary()); + type_display = TR("tx_shielded_detail"); // "Shielded (moved to your own z-address)" (F015) } else { - type_color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f); + type_color = ImGui::ColorConvertU32ToFloat4(material::OnSurfaceMedium()); // themed (F033) type_display = tx.type; } @@ -78,7 +81,12 @@ void TransactionDetailsDialog::render(App* app) ImGui::SameLine(ImGui::GetWindowWidth() - confLbl.position); // Confirmations badge - if (tx.confirmations == 0) { + if (tx.confirmations < 0) { // conflicted / double-spent / reorged out (F016) + ImGui::TextColored(material::ErrorVec4(), "%s", TR("tx_dropped")); + } else if (tx.confirmations == 0 && tx.timestamp > 0 && + static_cast(std::time(nullptr)) - tx.timestamp > 3600) { + ImGui::TextColored(material::WarningVec4(), "%s", TR("tx_stale_pending")); + } else if (tx.confirmations == 0) { ImGui::TextColored(material::WarningVec4(), "%s", TR("pending")); } else if (tx.confirmations < 10) { ImGui::TextColored(material::WarningVec4(), TR("tx_confirmations"), tx.confirmations); @@ -103,7 +111,9 @@ void TransactionDetailsDialog::render(App* app) double price_usd = app->state().market.price_usd; if (price_usd > 0) { ImGui::SameLine(); - ImGui::TextDisabled("(~$%.2f USD)", std::abs(tx.amount) * price_usd); + double usd = std::abs(tx.amount) * price_usd; + if (usd > 0.0 && usd < 0.01) ImGui::TextDisabled("(~$%.4f USD)", usd); // tiered for tiny amounts (F033) + else ImGui::TextDisabled("(~$%.2f USD)", usd); } ImGui::Spacing(); diff --git a/src/util/i18n.cpp b/src/util/i18n.cpp index 21b8b3f..629605e 100644 --- a/src/util/i18n.cpp +++ b/src/util/i18n.cpp @@ -1350,6 +1350,7 @@ void I18n::loadBuiltinEnglish() strings_["no_matching"] = "No matching transactions"; strings_["clear_filters"] = "Clear filters"; strings_["tx_immature"] = "Immature (%d/100)"; + strings_["tx_shielded_detail"] = "Shielded (moved to your own z-address)"; strings_["transaction_id"] = "TRANSACTION ID"; strings_["search_placeholder"] = "Search..."; strings_["all_filter"] = "All";