put color constants in guiconstants.h
This commit is contained in:
parent
daa1a7398f
commit
bbae0fc9ef
3 changed files with 11 additions and 5 deletions
|
@ -4,8 +4,12 @@
|
||||||
/* milliseconds between model updates */
|
/* milliseconds between model updates */
|
||||||
static const int MODEL_UPDATE_DELAY = 500;
|
static const int MODEL_UPDATE_DELAY = 500;
|
||||||
|
|
||||||
/* size of cache */
|
/* Invalid field background style */
|
||||||
static const unsigned int WALLET_CACHE_SIZE = 100;
|
#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
|
#endif // GUICONSTANTS_H
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "qvalidatedlineedit.h"
|
#include "qvalidatedlineedit.h"
|
||||||
|
|
||||||
|
#include "guiconstants.h"
|
||||||
|
|
||||||
QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) :
|
QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) :
|
||||||
QLineEdit(parent), valid(true)
|
QLineEdit(parent), valid(true)
|
||||||
{
|
{
|
||||||
|
@ -19,7 +21,7 @@ void QValidatedLineEdit::setValid(bool valid)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setStyleSheet("background:#FF8080");
|
setStyleSheet(STYLE_INVALID);
|
||||||
}
|
}
|
||||||
this->valid = valid;
|
this->valid = valid;
|
||||||
}
|
}
|
||||||
|
|
|
@ -514,11 +514,11 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const
|
||||||
/* Non-confirmed transactions are grey */
|
/* Non-confirmed transactions are grey */
|
||||||
if(!rec->status.confirmed)
|
if(!rec->status.confirmed)
|
||||||
{
|
{
|
||||||
return QColor(128, 128, 128);
|
return COLOR_UNCONFIRMED;
|
||||||
}
|
}
|
||||||
if(index.column() == Amount && (rec->credit+rec->debit) < 0)
|
if(index.column() == Amount && (rec->credit+rec->debit) < 0)
|
||||||
{
|
{
|
||||||
return QColor(255, 0, 0);
|
return COLOR_NEGATIVE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (role == TypeRole)
|
else if (role == TypeRole)
|
||||||
|
|
Loading…
Reference in a new issue