diff options
| author | Wladimir J. van der Laan <[email protected]> | 2011-07-25 18:39:52 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2011-07-25 18:39:52 +0200 |
| commit | bbae0fc9efa6eb7155d679a1cc3eeb451d594d14 (patch) | |
| tree | 516d2f264cd035a2cc92f0ca98ea99c2f1cede8b /src | |
| parent | better exit icon (diff) | |
| download | discoin-bbae0fc9efa6eb7155d679a1cc3eeb451d594d14.tar.xz discoin-bbae0fc9efa6eb7155d679a1cc3eeb451d594d14.zip | |
put color constants in guiconstants.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/qt/guiconstants.h | 8 | ||||
| -rw-r--r-- | src/qt/qvalidatedlineedit.cpp | 4 | ||||
| -rw-r--r-- | src/qt/transactiontablemodel.cpp | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 59f49625b..79856d478 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -4,8 +4,12 @@ /* milliseconds between model updates */ static const int MODEL_UPDATE_DELAY = 500; -/* size of cache */ -static const unsigned int WALLET_CACHE_SIZE = 100; +/* Invalid field background style */ +#define STYLE_INVALID "background:#FF8080" +/* Transaction list -- unconfirmed transaction */ +#define COLOR_UNCONFIRMED QColor(128, 128, 128) +/* Transaction list -- negative amount */ +#define COLOR_NEGATIVE QColor(128, 128, 128) #endif // GUICONSTANTS_H diff --git a/src/qt/qvalidatedlineedit.cpp b/src/qt/qvalidatedlineedit.cpp index 2430cc9fb..8ca230c9d 100644 --- a/src/qt/qvalidatedlineedit.cpp +++ b/src/qt/qvalidatedlineedit.cpp @@ -1,5 +1,7 @@ #include "qvalidatedlineedit.h" +#include "guiconstants.h" + QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) : QLineEdit(parent), valid(true) { @@ -19,7 +21,7 @@ void QValidatedLineEdit::setValid(bool valid) } else { - setStyleSheet("background:#FF8080"); + setStyleSheet(STYLE_INVALID); } this->valid = valid; } diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 17622e07f..7062ceecb 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -514,11 +514,11 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const /* Non-confirmed transactions are grey */ if(!rec->status.confirmed) { - return QColor(128, 128, 128); + return COLOR_UNCONFIRMED; } if(index.column() == Amount && (rec->credit+rec->debit) < 0) { - return QColor(255, 0, 0); + return COLOR_NEGATIVE; } } else if (role == TypeRole) |