┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-10-07 10:53:33 +0000
committerPeter Penz <[email protected]>2007-10-07 10:53:33 +0000
commitcf83ceb29622c920de86e8e83c5cff1047dd318a (patch)
treecb0cd93ae1af78a7cf8d9cd0594a52c4807af9c7 /src/dolphinview.cpp
parentc1a0fb31612abb77069d8ece15f6ffb16d2d1871 (diff)
* assure that the columns of the colum-view get dimmed if the colum-view is inactive
* updated documentation of DolphinController + minor cleanups svn path=/trunk/KDE/kdebase/apps/; revision=722452
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 75c1ee01c..51dbb708c 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -133,12 +133,29 @@ void DolphinView::setActive(bool active)
m_active = active;
- updateViewportColor();
+ QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
+ if (active) {
+ // TODO: emitting urlChanged() is a hack, as the URL hasn't really changed. It
+ // bypasses the problem when having a split view and changing the active view to
+ // update the some URL dependent states. A nicer approach should be no big deal...
+ emit urlChanged(url());
+ emit selectionChanged(selectedItems());
+ } else {
+ color.setAlpha(150);
+ }
+
+ QWidget* viewport = itemView()->viewport();
+ QPalette palette;
+ palette.setColor(viewport->backgroundRole(), color);
+ viewport->setPalette(palette);
+
update();
if (active) {
emit activated();
}
+
+ m_controller->indicateActivationChange(active);
}
bool DolphinView::isActive() const
@@ -433,10 +450,14 @@ void DolphinView::reload()
void DolphinView::refresh()
{
+ const bool oldActivationState = m_active;
+ m_active = true;
+
createView();
applyViewProperties(m_controller->url());
reload();
- updateViewportColor();
+
+ setActive(oldActivationState);
}
void DolphinView::updateView(const KUrl& url, const KUrl& rootUrl)
@@ -906,20 +927,4 @@ void DolphinView::applyCutItemEffect()
}
}
-void DolphinView::updateViewportColor()
-{
- QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color();
- if (m_active) {
- emit urlChanged(url()); // Hmm, this is a hack; the url hasn't really changed.
- emit selectionChanged(selectedItems());
- } else {
- color.setAlpha(0);
- }
-
- QWidget* viewport = itemView()->viewport();
- QPalette palette;
- palette.setColor(viewport->backgroundRole(), color);
- viewport->setPalette(palette);
-}
-
#include "dolphinview.moc"