Skip to content

Commit

Permalink
[welcome page] improve rounded rect background color
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jul 24, 2017
1 parent 7321434 commit 1961795
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/qgswelcomepageitemsmodel.cpp
Expand Up @@ -42,26 +42,28 @@ void QgsWelcomePageItemDelegate::paint( QPainter *painter, const QStyleOptionVie
QAbstractTextDocumentLayout::PaintContext ctx;
QStyleOptionViewItem optionV4 = option;

QColor color;
QColor color = optionV4.palette.color( QPalette::Active, QPalette::Window );
if ( option.state & QStyle::State_Selected && option.state & QStyle::State_HasFocus )
{
color = QColor( 255, 255, 255, 60 );
color.setAlpha( 40 );
ctx.palette.setColor( QPalette::Text, optionV4.palette.color( QPalette::Active, QPalette::HighlightedText ) );

QStyle *style = QApplication::style();
style->drawPrimitive( QStyle::PE_PanelItemViewItem, &option, painter, nullptr );
}
else if ( option.state & QStyle::State_Enabled )
{
color = QColor( 100, 100, 100, 30 );
if ( option.state & QStyle::State_Selected )
{
color.setAlpha( 40 );
}
ctx.palette.setColor( QPalette::Text, optionV4.palette.color( QPalette::Active, QPalette::Text ) );

QStyle *style = QApplication::style();
style->drawPrimitive( QStyle::PE_PanelItemViewItem, &option, painter, nullptr );
}
else
{
color = QColor( 100, 100, 100, 30 );
ctx.palette.setColor( QPalette::Text, optionV4.palette.color( QPalette::Disabled, QPalette::Text ) );
}

Expand Down

0 comments on commit 1961795

Please sign in to comment.