diff options
| author | Peter Penz <[email protected]> | 2010-10-09 11:38:07 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2010-10-09 11:38:07 +0000 |
| commit | abd36cde0c3e41d933bd18a5d7c44e17d0e94ab9 (patch) | |
| tree | ca1995c2cc576a05757cc762bfe46c9181765bba /src | |
| parent | 585bb5994010c6bf64f7bb29ba4df903acc44a3e (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/views/dolphincolumnview.cpp | 15 |
1 files 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); } } |
