From cf83ceb29622c920de86e8e83c5cff1047dd318a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 7 Oct 2007 10:53:33 +0000 Subject: * 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 --- src/dolphinview.cpp | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'src/dolphinview.cpp') 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" -- cgit v1.3