Don't prelight color palette button if it is not enabled.

This commit is contained in:
Jim Evins
2016-05-18 20:12:24 -04:00
parent 310cd1c307
commit 1ce647b9a9
+2 -2
View File
@@ -57,7 +57,7 @@ void ColorPaletteButtonItem::paintEvent( QPaintEvent* event )
// //
// Draw background // Draw background
// //
if ( mHover ) if ( isEnabled() && mHover )
{ {
QLinearGradient gradient( 0, 0, 0, height() ); QLinearGradient gradient( 0, 0, 0, height() );
gradient.setColorAt( 0, palette().color( QPalette::Highlight ).lighter() ); gradient.setColorAt( 0, palette().color( QPalette::Highlight ).lighter() );
@@ -76,7 +76,7 @@ void ColorPaletteButtonItem::paintEvent( QPaintEvent* event )
// //
painter.setBrush( QBrush( Qt::NoBrush ) ); painter.setBrush( QBrush( Qt::NoBrush ) );
if ( mHover ) if ( isEnabled() && mHover )
{ {
painter.setPen( QPen( palette().color( QPalette::HighlightedText ) ) ); painter.setPen( QPen( palette().color( QPalette::HighlightedText ) ) );
} }