Change hover style of ColorPaletteItems.
This commit is contained in:
@@ -81,23 +81,6 @@ namespace glabels
|
||||
{
|
||||
QPainter painter(this);
|
||||
|
||||
//
|
||||
// Draw background
|
||||
//
|
||||
if ( isEnabled() && mHover )
|
||||
{
|
||||
QLinearGradient gradient( 0, 0, 0, height() );
|
||||
gradient.setColorAt( 0, palette().color( QPalette::Highlight ).lighter() );
|
||||
gradient.setColorAt( 1, palette().color( QPalette::Highlight ) );
|
||||
painter.setBrush( QBrush( gradient ) );
|
||||
|
||||
QPen pen( palette().color( QPalette::Text ) );
|
||||
pen.setWidth( hoverBgOutlineWidthPixels );
|
||||
painter.setPen( pen );
|
||||
|
||||
painter.drawRect( 0, 0, width()-1, height()-1 );
|
||||
}
|
||||
|
||||
//
|
||||
// Draw swatch
|
||||
//
|
||||
@@ -105,15 +88,20 @@ namespace glabels
|
||||
{
|
||||
if ( mHover )
|
||||
{
|
||||
QPen pen( palette().color( QPalette::HighlightedText ) );
|
||||
pen.setWidth( outlineWidthPixels );
|
||||
QPen pen( palette().color( QPalette::Text ) );
|
||||
pen.setWidth( 2*outlineWidthPixels );
|
||||
pen.setJoinStyle( Qt::MiterJoin );
|
||||
painter.setPen( pen );
|
||||
painter.setBrush( QBrush( mColor ) );
|
||||
painter.drawRect( 1, 1, width()-2, height()-2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
QPen pen( palette().color( QPalette::Text ) );
|
||||
pen.setWidth( outlineWidthPixels );
|
||||
painter.setPen( pen );
|
||||
painter.setBrush( QBrush( mColor ) );
|
||||
painter.drawRect( border, border, wSwatch, hSwatch );
|
||||
}
|
||||
|
||||
|
||||
@@ -123,12 +111,12 @@ namespace glabels
|
||||
QPen pen( palette().color( QPalette::Disabled, QPalette::Text ) );
|
||||
pen.setWidth( outlineWidthPixels );
|
||||
painter.setPen( pen );
|
||||
}
|
||||
|
||||
painter.setBrush( QBrush( mColor ) );
|
||||
painter.drawRect( border, border, wSwatch, hSwatch );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Enter Event
|
||||
|
||||
Reference in New Issue
Block a user