From abd36cde0c3e41d933bd18a5d7c44e17d0e94ab9 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 9 Oct 2010 11:38:07 +0000 Subject: [PATCH] Indicate the shown directory of a column by QStyle::PE_FrameFocusRect instead of using a custom code. svn path=/trunk/KDE/kdebase/apps/; revision=1184180 --- src/views/dolphincolumnview.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/dolphincolumnview.cpp b/src/views/dolphincolumnview.cpp index 1fdc3e0b2..baae66107 100644 --- a/src/views/dolphincolumnview.cpp +++ b/src/views/dolphincolumnview.cpp @@ -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); } } -- 2.47.3