From: vsr Date: Thu, 6 Apr 2017 17:10:26 +0000 (+0300) Subject: Fix problem with bad rendering of QtxColorButton when it is small. X-Git-Tag: V8_3_0rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=389df39111c66aca8ca72364e1fbd76eb8f8c30a;p=modules%2Fgui.git Fix problem with bad rendering of QtxColorButton when it is small. --- diff --git a/src/Qtx/QtxColorButton.cxx b/src/Qtx/QtxColorButton.cxx index 5ba031640..3825fd5a6 100644 --- a/src/Qtx/QtxColorButton.cxx +++ b/src/Qtx/QtxColorButton.cxx @@ -413,6 +413,17 @@ QList QtxColorButton::colorsList() const return lst; } +/*! + \brief Get size hint for this widget. +*/ +QSize QtxColorButton::sizeHint() const +{ + QSize sz = QToolButton::sizeHint(); + sz.setWidth( sz.width() + 18 ); + return sz; +} + + /*! \fn void QtxColorButton::clicked( QColor color ); \brief This signal is emitted when the widget button is clicked by diff --git a/src/Qtx/QtxColorButton.h b/src/Qtx/QtxColorButton.h index 9f5472aeb..152cf5cd9 100644 --- a/src/Qtx/QtxColorButton.h +++ b/src/Qtx/QtxColorButton.h @@ -51,6 +51,8 @@ public: QString autoText() const; void setAutoText( const QString& ); + QSize sizeHint() const; + signals: void clicked( QColor ); void changed( QColor );