diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 7cdfa77..e8e703b 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -13,16 +13,14 @@ static const int STATUSBAR_ICONSIZE = 16; /* Invalid field background style */ #define STYLE_INVALID "border: 1px solid #ff0000;background:#1c1c1c;color: #e32105;" -/* Transaction list -- unconfirmed transaction (text only) */ +/* Transaction list -- unconfirmed transaction (0 confirms: grey, both directions) */ #define COLOR_UNCONFIRMED QColor(97, 40, 14) /* Transaction list -- negative amount (confirmed: spent) */ #define COLOR_NEGATIVE QColor(255, 0, 0) -/* Transaction list -- positive amount (confirmed: received/mined) */ +/* Transaction list -- positive amount (fully confirmed, depth >= RecommendedNumConfirmations) */ #define COLOR_POSITIVE QColor(124, 219, 138) -/* Transaction list -- unconfirmed positive amount (pending credit, dim green) */ -#define COLOR_UNCONFIRMED_POSITIVE QColor(61, 139, 90) -/* Transaction list -- unconfirmed negative amount (pending debit, dim red) */ -#define COLOR_UNCONFIRMED_NEGATIVE QColor(142, 26, 4) +/* Transaction list -- partially confirmed positive amount (1..RecommendedNumConfirmations-1 confirms) */ +#define COLOR_CONFIRMING QColor(197, 235, 201) /* Transaction list -- bare address (without label) */ #define COLOR_BAREADDRESS QColor(97, 40, 14) diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 7da307d..e451fdf 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -52,11 +52,15 @@ public: if(amount < 0) { - foreground = confirmed ? COLOR_NEGATIVE : COLOR_UNCONFIRMED_NEGATIVE; + foreground = COLOR_NEGATIVE; } else if(!confirmed) { - foreground = COLOR_UNCONFIRMED_POSITIVE; + foreground = COLOR_UNCONFIRMED; + } + else if(index.data(TransactionTableModel::StatusRole).toInt() == (int)TransactionStatus::Confirming) + { + foreground = COLOR_CONFIRMING; } else { diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 76c90e8..1d404c0 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -577,17 +577,28 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const case Qt::TextAlignmentRole: return column_alignments[index.column()]; case Qt::ForegroundRole: - // Amount column: 4 states — confirmed/unconfirmed × positive/negative. - // Other columns fall through to addressColor/etc. + // Amount column color rule (3 tiers for positives, 2 for negatives): + // 0 confirms (Unconfirmed) -> COLOR_UNCONFIRMED grey + // Confirming (1..RecommendedNumConfirmations-1) -> COLOR_CONFIRMING light green (positives only) + // Confirmed (depth >= RecommendedNumConfirmations) -> COLOR_POSITIVE bright green + // Immature stays olive via stylesheet (unchanged) + // Conflicted (depth < 0) -> COLOR_UNCONFIRMED grey + // Negative amounts (spent) stay red across all confirmation tiers. if(index.column() == Amount) { qint64 amount = rec->credit + rec->debit; - bool unconfirmed = !rec->status.countsForBalance && rec->status.status != TransactionStatus::Immature; - if(unconfirmed) + // Grey: unconfirmed, conflicted, or otherwise not counting for balance (and not immature) + if(!rec->status.countsForBalance && rec->status.status != TransactionStatus::Immature) { - return amount < 0 ? COLOR_UNCONFIRMED_NEGATIVE : COLOR_UNCONFIRMED_POSITIVE; + return COLOR_UNCONFIRMED; } - return amount < 0 ? COLOR_NEGATIVE : COLOR_POSITIVE; + // Negative amounts always red (spent), no matter confirmation tier + if(amount < 0) + { + return COLOR_NEGATIVE; + } + // Positive amounts: lighter green while still confirming, bright green once fully confirmed + return rec->status.status == TransactionStatus::Confirming ? COLOR_CONFIRMING : COLOR_POSITIVE; } if(!rec->status.countsForBalance && rec->status.status != TransactionStatus::Immature) {