Skip to content
Permalink
Browse files

Reduce default height of QgsColorButton. For Mac, only show color whe…

…n window is active.

git-svn-id: http://svn.osgeo.org/qgis/trunk@6308 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski
telwertowski committed Dec 22, 2006
1 parent ead3530 commit a039bdd16921bfda36268853fe3352b342cc07e5
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/gui/qgscolorbutton.cpp
@@ -34,7 +34,9 @@

QgsColorButton::QgsColorButton(QWidget *parent)
: QToolButton(parent)
{}
{
setToolButtonStyle(Qt::ToolButtonTextOnly); // decrease default button height
}

QgsColorButton::~QgsColorButton()
{}
@@ -45,7 +47,12 @@ QgsColorButton::~QgsColorButton()
void QgsColorButton::paintEvent(QPaintEvent *e)
{
QToolButton::paintEvent(e);
if (isEnabled())
if (
#ifdef Q_WS_MAC
// Mac shows color only a when a window is active
isActiveWindow() &&
#endif
isEnabled())
{
QPainter p(this);
int margin = 2; // Leave some space for highlighting

0 comments on commit a039bdd

Please sign in to comment.
You can’t perform that action at this time.