Change hover style of ColorPaletteItems.
This commit is contained in:
@@ -81,23 +81,6 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
QPainter painter(this);
|
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
|
// Draw swatch
|
||||||
//
|
//
|
||||||
@@ -105,15 +88,20 @@ namespace glabels
|
|||||||
{
|
{
|
||||||
if ( mHover )
|
if ( mHover )
|
||||||
{
|
{
|
||||||
QPen pen( palette().color( QPalette::HighlightedText ) );
|
QPen pen( palette().color( QPalette::Text ) );
|
||||||
pen.setWidth( outlineWidthPixels );
|
pen.setWidth( 2*outlineWidthPixels );
|
||||||
|
pen.setJoinStyle( Qt::MiterJoin );
|
||||||
painter.setPen( pen );
|
painter.setPen( pen );
|
||||||
|
painter.setBrush( QBrush( mColor ) );
|
||||||
|
painter.drawRect( 1, 1, width()-2, height()-2 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QPen pen( palette().color( QPalette::Text ) );
|
QPen pen( palette().color( QPalette::Text ) );
|
||||||
pen.setWidth( outlineWidthPixels );
|
pen.setWidth( outlineWidthPixels );
|
||||||
painter.setPen( pen );
|
painter.setPen( pen );
|
||||||
|
painter.setBrush( QBrush( mColor ) );
|
||||||
|
painter.drawRect( border, border, wSwatch, hSwatch );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -123,10 +111,10 @@ namespace glabels
|
|||||||
QPen pen( palette().color( QPalette::Disabled, QPalette::Text ) );
|
QPen pen( palette().color( QPalette::Disabled, QPalette::Text ) );
|
||||||
pen.setWidth( outlineWidthPixels );
|
pen.setWidth( outlineWidthPixels );
|
||||||
painter.setPen( pen );
|
painter.setPen( pen );
|
||||||
|
painter.setBrush( QBrush( mColor ) );
|
||||||
|
painter.drawRect( border, border, wSwatch, hSwatch );
|
||||||
}
|
}
|
||||||
|
|
||||||
painter.setBrush( QBrush( mColor ) );
|
|
||||||
painter.drawRect( border, border, wSwatch, hSwatch );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user