From c349180c08418460a81a261f42df0434e0d18f78 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 12 Aug 2007 17:48:29 +0000 Subject: * fixed issue that when having a split view, that both views get the same color after OK or Apply has been pressed inside the Dolphin settings dialog * prepare for toggling the view icon depending from the activation state svn path=/trunk/KDE/kdebase/apps/; revision=699311 --- src/dolphinview.cpp | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'src/dolphinview.cpp') diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index a9f160d00..197b4d8f9 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -134,19 +134,7 @@ void DolphinView::setActive(bool active) m_active = active; - QColor color = KColorScheme(KColorScheme::View).background(); - if (active) { - emit urlChanged(url()); - emit selectionChanged(selectedItems()); - } else { - color.setAlpha(0); - } - - QWidget* viewport = itemView()->viewport(); - QPalette palette; - palette.setColor(viewport->backgroundRole(), color); - viewport->setPalette(palette); - + updateViewportColor(); update(); if (active) { @@ -438,6 +426,7 @@ void DolphinView::refresh() createView(); applyViewProperties(m_controller->url()); reload(); + updateViewportColor(); } void DolphinView::setUrl(const KUrl& url) @@ -964,4 +953,20 @@ void DolphinView::applyCutItemEffect() } } +void DolphinView::updateViewportColor() +{ + QColor color = KColorScheme(KColorScheme::View).background(); + if (m_active) { + emit urlChanged(url()); + emit selectionChanged(selectedItems()); + } else { + color.setAlpha(0); + } + + QWidget* viewport = itemView()->viewport(); + QPalette palette; + palette.setColor(viewport->backgroundRole(), color); + viewport->setPalette(palette); +} + #include "dolphinview.moc" -- cgit v1.3