Commit 6c420c1e authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

fix recursive event

parent a2e017e4
......@@ -28,7 +28,7 @@
// dtkWidgetsLayoutItemButton
// ///////////////////////////////////////////////////////////////////
class dtkWidgetsLayoutItemButton : public QLabel
class dtkWidgetsLayoutItemButton : public QFrame
{
Q_OBJECT
......@@ -50,7 +50,7 @@ private:
fa::icon m_icon;
};
dtkWidgetsLayoutItemButton::dtkWidgetsLayoutItemButton(fa::icon icon, QWidget *parent) : QLabel(parent)
dtkWidgetsLayoutItemButton::dtkWidgetsLayoutItemButton(fa::icon icon, QWidget *parent) : QFrame(parent)
{
dtkFontAwesome::instance()->initFontAwesome();
this->m_icon = icon;
......@@ -73,10 +73,13 @@ void dtkWidgetsLayoutItemButton::mousePressEvent(QMouseEvent *)
void dtkWidgetsLayoutItemButton::paintEvent(QPaintEvent *event)
{
QLabel::paintEvent(event);
QFrame::paintEvent(event);
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing);
dtkFontAwesome::instance()->setDefaultOption("color", dtkThemesEngine::instance()->color("@fg"));
this->setPixmap(dtkFontAwesome::instance()->icon(m_icon).pixmap(this->sizeHint()));
painter.drawPixmap(0, 0, 16, 16, dtkFontAwesome::instance()->icon(m_icon).pixmap(16, 16));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment