From 389df39111c66aca8ca72364e1fbd76eb8f8c30a Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 6 Apr 2017 20:10:26 +0300 Subject: [PATCH] Fix problem with bad rendering of QtxColorButton when it is small. --- src/Qtx/QtxColorButton.cxx | 11 +++++++++++ src/Qtx/QtxColorButton.h | 2 ++ 2 files changed, 13 insertions(+) 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 ); -- 2.39.2