Skip to content
Permalink
Browse files

[welcome page] improve rounded rect background color

  • Loading branch information
nirvn committed Jul 24, 2017
1 parent 7321434 commit 196179589197785affbbf1128eaf8baac4e8fc05
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/app/qgswelcomepageitemsmodel.cpp
@@ -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 ) );
}

0 comments on commit 1961795

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