Fix alignment
This commit is contained in:
@@ -15,11 +15,11 @@ class Turnstile;
|
|||||||
|
|
||||||
struct TransactionItem {
|
struct TransactionItem {
|
||||||
QString type;
|
QString type;
|
||||||
qint64 datetime;
|
qint64 datetime;
|
||||||
QString address;
|
QString address;
|
||||||
QString txid;
|
QString txid;
|
||||||
double amount;
|
double amount;
|
||||||
long confirmations;
|
long confirmations;
|
||||||
QString fromAddr;
|
QString fromAddr;
|
||||||
QString memo;
|
QString memo;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -104,8 +104,10 @@ void TxTableModel::updateAllData() {
|
|||||||
|
|
||||||
QVariant TxTableModel::data(const QModelIndex &index, int role) const
|
QVariant TxTableModel::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
// Align column 5 (amount) right
|
// Align column 4,5 (confirmations, amount) right
|
||||||
if (role == Qt::TextAlignmentRole && index.column() >= 3) return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
if (role == Qt::TextAlignmentRole &&
|
||||||
|
(index.column() == 3 || index.column() == 4))
|
||||||
|
return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
||||||
|
|
||||||
auto dat = modeldata->at(index.row());
|
auto dat = modeldata->at(index.row());
|
||||||
if (role == Qt::ForegroundRole) {
|
if (role == Qt::ForegroundRole) {
|
||||||
@@ -185,7 +187,8 @@ void TxTableModel::updateAllData() {
|
|||||||
|
|
||||||
QVariant TxTableModel::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant TxTableModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
{
|
{
|
||||||
if (role == Qt::TextAlignmentRole && section == 4) return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
if (role == Qt::TextAlignmentRole && (section == 3 || section == 4))
|
||||||
|
return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
||||||
|
|
||||||
if (role == Qt::FontRole) {
|
if (role == Qt::FontRole) {
|
||||||
QFont f;
|
QFont f;
|
||||||
|
|||||||
Reference in New Issue
Block a user