Skip to content

Commit d0e66ea

Browse files
author
telwertowski
committedDec 22, 2006
Reduce default height of QgsColorButton. For Mac, only show color when window is active.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6308 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 46ff6e0 commit d0e66ea

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed
 

‎src/gui/qgscolorbutton.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434

3535
QgsColorButton::QgsColorButton(QWidget *parent)
3636
: QToolButton(parent)
37-
{}
37+
{
38+
setToolButtonStyle(Qt::ToolButtonTextOnly); // decrease default button height
39+
}
3840

3941
QgsColorButton::~QgsColorButton()
4042
{}
@@ -45,7 +47,12 @@ QgsColorButton::~QgsColorButton()
4547
void QgsColorButton::paintEvent(QPaintEvent *e)
4648
{
4749
QToolButton::paintEvent(e);
48-
if (isEnabled())
50+
if (
51+
#ifdef Q_WS_MAC
52+
// Mac shows color only a when a window is active
53+
isActiveWindow() &&
54+
#endif
55+
isEnabled())
4956
{
5057
QPainter p(this);
5158
int margin = 2; // Leave some space for highlighting

0 commit comments

Comments
 (0)
Please sign in to comment.