mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-10 10:52:31 -05:00
fix drawing on gtk
This commit is contained in:
parent
82303fc3ca
commit
2ccd47596b
2 changed files with 9 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/icons" lang="edit">
|
<qresource prefix="/icons" lang="edit">
|
||||||
<file alias="address-book">res/icons/address-book.png</file>
|
|
||||||
<file alias="bitcoin">res/icons/bitcoin.png</file>
|
<file alias="bitcoin">res/icons/bitcoin.png</file>
|
||||||
|
<file alias="address-book">res/icons/address-book.png</file>
|
||||||
<file alias="quit">res/icons/quit.png</file>
|
<file alias="quit">res/icons/quit.png</file>
|
||||||
<file alias="send">res/icons/send.png</file>
|
<file alias="send">res/icons/send.png</file>
|
||||||
<file alias="toolbar">res/icons/toolbar.png</file>
|
<file alias="toolbar">res/icons/toolbar.png</file>
|
||||||
|
|
|
@ -10,17 +10,17 @@
|
||||||
#include "guiconstants.h"
|
#include "guiconstants.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QItemDelegate>
|
#include <QAbstractItemDelegate>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
#define DECORATION_SIZE 64
|
#define DECORATION_SIZE 64
|
||||||
#define NUM_ITEMS 3
|
#define NUM_ITEMS 3
|
||||||
|
|
||||||
class TxViewDelegate : public QItemDelegate
|
class TxViewDelegate : public QAbstractItemDelegate
|
||||||
{
|
{
|
||||||
//Q_OBJECT
|
//Q_OBJECT
|
||||||
public:
|
public:
|
||||||
TxViewDelegate(): QItemDelegate(), unit(BitcoinUnits::BTC)
|
TxViewDelegate(): QAbstractItemDelegate(), unit(BitcoinUnits::BTC)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ public:
|
||||||
inline void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
inline void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index ) const
|
const QModelIndex &index ) const
|
||||||
{
|
{
|
||||||
//QItemDelegate::paint(painter, option, index);
|
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole));
|
QIcon icon = qvariant_cast<QIcon>(index.data(Qt::DecorationRole));
|
||||||
|
@ -81,6 +80,11 @@ public:
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||||
|
{
|
||||||
|
return QSize(DECORATION_SIZE, DECORATION_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
int unit;
|
int unit;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue