From 8e4e7ce5b248026d941fc4097cbd92032ef53b19 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 17 May 2007 12:00:50 +0000 Subject: [PATCH] when having split views: darken the background color of the inactive view svn path=/trunk/KDE/kdebase/apps/; revision=665612 --- src/dolphinmainwindow.cpp | 2 +- src/dolphinview.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 5b8b11bc1..ffe1c4e8e 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -733,7 +733,7 @@ void DolphinMainWindow::toggleSplitView() m_view[PrimaryIdx]->mode(), m_view[PrimaryIdx]->showHiddenFiles()); connectViewSignals(SecondaryIdx); - m_splitter->addWidget(m_view[SecondaryIdx]); + m_splitter->insertWidget(0, m_view[SecondaryIdx]); m_splitter->setSizes(QList() << newWidth << newWidth); m_view[SecondaryIdx]->reload(); m_view[SecondaryIdx]->show(); diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 8920aad4e..652274d63 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1159,10 +1160,23 @@ void DolphinView::emitContentsMoved() void DolphinView::updateActivationState() { m_urlNavigator->setActive(isActive()); + + QColor color = KGlobalSettings::baseColor(); if (isActive()) { emit urlChanged(url()); emit selectionChanged(selectedItems()); + } else { + // darken the background if the view is inactive + // TODO: does not work for a black background + color = color.darker(105); } + + QWidget* viewport = itemView()->viewport(); + QPalette palette; + palette.setColor(viewport->backgroundRole(), color); + viewport->setPalette(palette); + + update(); } void DolphinView::updateCutItems() -- 2.47.3