when having split views: darken the background color of the inactive view

svn path=/trunk/KDE/kdebase/apps/; revision=665612
This commit is contained in:
Peter Penz 2007-05-17 12:00:50 +00:00
parent 6d88d801ba
commit 8e4e7ce5b2
2 changed files with 15 additions and 1 deletions

View 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();

View 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()