r19963 by fschmid - Paint selection in Icon only mode too.

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 4 08:26:07 UTC 2015


Author: fschmid
Date: Sat Apr  4 08:26:07 2015
New Revision: 19963

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19963
Log:
Paint selection in Icon only mode too.

Modified:
    trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp

Modified: trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19963&path=/trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp (original)
+++ trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp Sat Apr  4 08:26:07 2015
@@ -36,6 +36,15 @@
 		painter->save();
 		QIcon icon = index.data(Qt::DecorationRole).value<QIcon>();
 		painter->drawPixmap(option.rect, icon.pixmap(m_view->iconSize()));
+		QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
+		if (cg == QPalette::Normal && !(option.state & QStyle::State_Active))
+			cg = QPalette::Inactive;
+		if (option.state & QStyle::State_Selected)
+		{
+			QColor sele = option.palette.brush(cg, QPalette::Highlight).color();
+			sele.setAlphaF(0.3);
+			painter->fillRect(option.rect, sele);
+		}
 		painter->restore();
 	}
 	else




More information about the scribus-commit mailing list