From 2ccd47596b14111f8be4984bde469adbc316db0d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 3 Aug 2011 21:28:11 +0200 Subject: [PATCH] fix drawing on gtk --- src/qt/bitcoin.qrc | 2 +- src/qt/overviewpage.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index e56536199..629349c65 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -1,7 +1,7 @@ - res/icons/address-book.png res/icons/bitcoin.png + res/icons/address-book.png res/icons/quit.png res/icons/send.png res/icons/toolbar.png diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 98f0476ba..8aa3bb860 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -10,17 +10,17 @@ #include "guiconstants.h" #include -#include +#include #include #define DECORATION_SIZE 64 #define NUM_ITEMS 3 -class TxViewDelegate : public QItemDelegate +class TxViewDelegate : public QAbstractItemDelegate { //Q_OBJECT public: - TxViewDelegate(): QItemDelegate(), unit(BitcoinUnits::BTC) + TxViewDelegate(): QAbstractItemDelegate(), unit(BitcoinUnits::BTC) { } @@ -28,7 +28,6 @@ public: inline void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const { - //QItemDelegate::paint(painter, option, index); painter->save(); QIcon icon = qvariant_cast(index.data(Qt::DecorationRole)); @@ -81,6 +80,11 @@ public: painter->restore(); } + inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const + { + return QSize(DECORATION_SIZE, DECORATION_SIZE); + } + int unit; };