From: Peter Penz Date: Fri, 18 Nov 2011 21:52:07 +0000 (+0100) Subject: Apply the selected-state to the current item X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d4d83e04e54adc761a90cf6fb4617b48e5822499?ds=inline Apply the selected-state to the current item This assures that (with the default colors) the indication of the current item is done in white instead of black. --- diff --git a/src/kitemviews/kitemlistwidget.cpp b/src/kitemviews/kitemlistwidget.cpp index 193422259..24840724c 100644 --- a/src/kitemviews/kitemlistwidget.cpp +++ b/src/kitemviews/kitemlistwidget.cpp @@ -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); }