diff options
| author | Peter Penz <[email protected]> | 2007-05-17 12:00:50 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-05-17 12:00:50 +0000 |
| commit | 8e4e7ce5b248026d941fc4097cbd92032ef53b19 (patch) | |
| tree | 2cddde037a440a8b701eec3bc68a36838a25baa8 /src/dolphinview.cpp | |
| parent | 6d88d801baf44dafa11975fde1007ea53063db29 (diff) | |
when having split views: darken the background color of the inactive view
svn path=/trunk/KDE/kdebase/apps/; revision=665612
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 <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() |
