Message info
 
To:kde-commits@kde.org From:Jean-Baptiste Mardelle Subject:[calligra] libs/main: Add standard hover effect to treeviews like layers widget in Krita Date:Thu, 12 Apr 2012 17:28:59 +0200 (CEST)
 

Git commit df9a20b4747e5126adb1c526d827a621938028c0 by Jean-Baptiste Mardelle.
Committed on 12/04/2012 at 17:26.
Pushed by mardelle into branch 'master'.

Add standard hover effect to treeviews like layers widget in Krita

REVIEW: 104556

M +5 -4 libs/main/KoDocumentSectionDelegate.cpp

http://commits.kde.org/calligra/df9a20b4747e5126adb1c526d827a621938028c0

diff --git a/libs/main/KoDocumentSectionDelegate.cpp b/libs/main/KoDocumentSectionDelegate.cpp
index 3cb7b56..50355d4 100644
--- a/libs/main/KoDocumentSectionDelegate.cpp
+++ b/libs/main/KoDocumentSectionDelegate.cpp
@@ -82,11 +82,12 @@ void KoDocumentSectionDelegate::paint(QPainter *p, const QStyleOptionViewItem &o
{
p->save();
{
- QStyleOptionViewItem option = getOptions(o, index);
- p->setFont(option.font);
+
+ QStyleOptionViewItemV4 option = getOptions(o, index);
+ QStyle *style = option.widget ? option.widget->style() : QApplication::style();
+ style->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, p, option.widget);

- if (option.state & QStyle::State_Selected)
- p->fillRect(option.rect, option.palette.highlight());
+ p->setFont(option.font);

drawText(p, option, index);
drawIcons(p, option, index);