Mercurial > hg > bitcoin
changeset 1212:a67e71eadb31 draft
put color constants in guiconstants.h
author | Wladimir J. van der Laan <laanwj@gmail.com> |
---|---|
date | Mon, 25 Jul 2011 18:39:52 +0200 |
parents | b19718db04ec |
children | b76439e5e887 |
files | src/qt/guiconstants.h src/qt/qvalidatedlineedit.cpp src/qt/transactiontablemodel.cpp |
diffstat | 3 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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 @@ } else { - setStyleSheet("background:#FF8080"); + setStyleSheet(STYLE_INVALID); } this->valid = valid; }
--- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -514,11 +514,11 @@ /* 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)