mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 00:11:21 +00:00
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:
parent
6d88d801ba
commit
8e4e7ce5b2
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue