Placement of transaction-amount adjusted (unconfirmed transactions didn't fit)

This commit is contained in:
crowning- 2015-03-22 21:29:29 +01:00
parent ef74e261e5
commit bcb148eeab

View File

@ -23,6 +23,7 @@
#include <QTimer> #include <QTimer>
#define DECORATION_SIZE 48 #define DECORATION_SIZE 48
#define ICON_OFFSET 16
#define NUM_ITEMS 3 #define NUM_ITEMS 3
class TxViewDelegate : public QAbstractItemDelegate class TxViewDelegate : public QAbstractItemDelegate
@ -41,12 +42,12 @@ public:
QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole)); QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole));
QRect mainRect = option.rect; QRect mainRect = option.rect;
mainRect.moveLeft(16); mainRect.moveLeft(ICON_OFFSET);
QRect decorationRect(mainRect.topLeft(), QSize(DECORATION_SIZE, DECORATION_SIZE)); QRect decorationRect(mainRect.topLeft(), QSize(DECORATION_SIZE, DECORATION_SIZE));
int xspace = DECORATION_SIZE + 8; int xspace = DECORATION_SIZE + 8;
int ypad = 6; int ypad = 6;
int halfheight = (mainRect.height() - 2*ypad)/2; int halfheight = (mainRect.height() - 2*ypad)/2;
QRect amountRect(mainRect.left() + xspace, mainRect.top()+ypad, mainRect.width() - xspace, halfheight); QRect amountRect(mainRect.left() + xspace, mainRect.top()+ypad, mainRect.width() - xspace - ICON_OFFSET, halfheight);
QRect addressRect(mainRect.left() + xspace, mainRect.top()+ypad+halfheight, mainRect.width() - xspace, halfheight); QRect addressRect(mainRect.left() + xspace, mainRect.top()+ypad+halfheight, mainRect.width() - xspace, halfheight);
icon.paint(painter, decorationRect); icon.paint(painter, decorationRect);