From ad2a5315e4249fce141631fe276f0f3d9f186ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Thu, 7 Apr 2016 20:41:37 +0000 Subject: [PATCH] [GB.QT4] * BUG: Found a workaround for forcing Oxygen style to draw small push buttons correctly. [GB.QT5] * BUG: Found a workaround for forcing Oxygen style to draw small push buttons correctly. git-svn-id: svn://localhost/gambas/trunk@7729 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.qt4/src/fix_breeze.cpp | 14 ++++++++++++++ gb.qt4/src/fix_breeze.h | 1 + 2 files changed, 15 insertions(+) diff --git a/gb.qt4/src/fix_breeze.cpp b/gb.qt4/src/fix_breeze.cpp index 44cc5e286..01b850dd7 100644 --- a/gb.qt4/src/fix_breeze.cpp +++ b/gb.qt4/src/fix_breeze.cpp @@ -205,3 +205,17 @@ void FixBreezeStyle::drawComplexControl(ComplexControl element, const QStyleOpti QProxyStyle::drawComplexControl(element, option, painter, widget); } + +void FixBreezeStyle::drawControl(ControlElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget) const +{ + QStyleOptionButton newOption; + + if (element == CE_PushButtonBevel) + { + newOption = *(QStyleOptionButton *)option; + newOption.iconSize = QSize(0, 0); + option = &newOption; + } + + QProxyStyle::drawControl(element, option, painter, widget); +} diff --git a/gb.qt4/src/fix_breeze.h b/gb.qt4/src/fix_breeze.h index eb36cca59..4172941f4 100644 --- a/gb.qt4/src/fix_breeze.h +++ b/gb.qt4/src/fix_breeze.h @@ -36,6 +36,7 @@ public: void drawComplexControl(ComplexControl, const QStyleOptionComplex*, QPainter*, const QWidget*) const; void drawPrimitive(PrimitiveElement, const QStyleOption*, QPainter*, const QWidget*) const; + void drawControl(ControlElement, const QStyleOption *, QPainter *, const QWidget *) const; QRect visualRect(const QStyleOption* opt, const QRect& subRect) const { return QProxyStyle::visualRect(opt->direction, opt->rect, subRect); }