]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Apply the selected-state to the current item
authorPeter Penz <peter.penz19@gmail.com>
Fri, 18 Nov 2011 21:52:07 +0000 (22:52 +0100)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 18 Nov 2011 21:53:16 +0000 (22:53 +0100)
This assures that (with the default colors) the indication
of the current item is done in white instead of black.

src/kitemviews/kitemlistwidget.cpp

index 1934222593a3418f7b8c64fedea98cedefa5c6f2..24840724cda08372679b3f5da57ca5e852f60017 100644 (file)
@@ -123,6 +123,9 @@ void KItemListWidget::paint(QPainter* painter, const QStyleOptionGraphicsItem* o
         viewItemOption.initFrom(widget);
         viewItemOption.rect = textRect().toRect();
         viewItemOption.state = QStyle::State_Enabled | QStyle::State_Item;
+        if (m_selected) {
+            viewItemOption.state |= QStyle::State_Selected;
+        }
         viewItemOption.viewItemPosition = QStyleOptionViewItemV4::OnlyOne;
         style()->drawPrimitive(QStyle::PE_FrameFocusRect, &viewItemOption, painter, widget);
     }