]> cloud.milkyroute.net Git - dolphin.git/commitdiff
when having split views: darken the background color of the inactive view
authorPeter Penz <peter.penz19@gmail.com>
Thu, 17 May 2007 12:00:50 +0000 (12:00 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 17 May 2007 12:00:50 +0000 (12:00 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=665612

src/dolphinmainwindow.cpp
src/dolphinview.cpp

index 5b8b11bc1ff7c07b9545aea628e5ba3556260a86..ffe1c4e8e646a8888d48bcf241dd0c216a484e2e 100644 (file)
@@ -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<int>() << newWidth << newWidth);
         m_view[SecondaryIdx]->reload();
         m_view[SecondaryIdx]->show();
index 8920aad4e91194bea000770cd8d87632ca6823ad..652274d63b6a979daf5cf26791c722ef8c4b00a6 100644 (file)
@@ -31,6 +31,7 @@
 #include <kdirmodel.h>
 #include <kfileitemdelegate.h>
 #include <kfileplacesmodel.h>
+#include <kglobalsettings.h>
 #include <klocale.h>
 #include <kiconeffect.h>
 #include <kio/netaccess.h>
@@ -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()