]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Indicate the shown directory of a column by QStyle::PE_FrameFocusRect instead of...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 9 Oct 2010 11:38:07 +0000 (11:38 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 9 Oct 2010 11:38:07 +0000 (11:38 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=1184180

src/views/dolphincolumnview.cpp

index 1fdc3e0b26bd886f7ce4f793ebe54961778d8558..baae6610704154a175f2eb290cf14ddb5a3c98d4 100644 (file)
@@ -268,17 +268,18 @@ void DolphinColumnView::dropEvent(QDropEvent* event)
 void DolphinColumnView::paintEvent(QPaintEvent* event)
 {
     if (!m_childUrl.isEmpty()) {
-        // indicate the shown URL of the next column by highlighting the shown folder item
+        // Indicate the shown URL of the next column by highlighting the shown folder item
         const QModelIndex dirIndex = m_dolphinModel->indexForUrl(m_childUrl);
         const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex);
         if (proxyIndex.isValid() && !selectionModel()->isSelected(proxyIndex)) {
-            const QRect itemRect = visualRect(proxyIndex);
             QPainter painter(viewport());
-            QColor color = KColorScheme(QPalette::Active, KColorScheme::View).foreground().color();
-            color.setAlpha(32);
-            painter.setPen(Qt::NoPen);
-            painter.setBrush(color);
-            painter.drawRect(itemRect);
+
+            QStyleOptionViewItemV4 option;
+            option.initFrom(this);
+            option.rect = visualRect(proxyIndex);
+            option.state = QStyle::State_Enabled | QStyle::State_HasFocus;
+            option.viewItemPosition = QStyleOptionViewItemV4::OnlyOne;
+            style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter, this);
         }
     }