diff options
| author | Peter Penz <[email protected]> | 2007-10-07 10:53:33 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-10-07 10:53:33 +0000 |
| commit | cf83ceb29622c920de86e8e83c5cff1047dd318a (patch) | |
| tree | cb0cd93ae1af78a7cf8d9cd0594a52c4807af9c7 /src/dolphincolumnwidget.cpp | |
| parent | c1a0fb31612abb77069d8ece15f6ffb16d2d1871 (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/dolphincolumnwidget.cpp')
| -rw-r--r-- | src/dolphincolumnwidget.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index eea70a8e3..3b38b6cd5 100644 --- a/src/dolphincolumnwidget.cpp +++ b/src/dolphincolumnwidget.cpp @@ -177,6 +177,19 @@ void DolphinColumnWidget::setShowPreview(bool show) } } +void DolphinColumnWidget::updateBackground() +{ + QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color(); + if (!m_active || !m_view->m_active) { + color.setAlpha(0); + } + QPalette palette = viewport()->palette(); + palette.setColor(viewport()->backgroundRole(), color); + viewport()->setPalette(palette); + + update(); +} + void DolphinColumnWidget::dragEnterEvent(QDragEnterEvent* event) { if (event->mimeData()->hasUrls()) { @@ -252,7 +265,7 @@ void DolphinColumnWidget::paintEvent(QPaintEvent* event) void DolphinColumnWidget::mousePressEvent(QMouseEvent* event) { - m_view->m_controller->triggerActivation(); + m_view->m_controller->requestActivation(); if (!m_active) { m_view->requestActivation(this); } @@ -367,11 +380,6 @@ void DolphinColumnWidget::activate() this, SLOT(triggerItem(const QModelIndex&))); } - const QColor bgColor = KColorScheme(QPalette::Active, KColorScheme::View).background().color(); - QPalette palette = viewport()->palette(); - palette.setColor(viewport()->backgroundRole(), bgColor); - viewport()->setPalette(palette); - if (!m_childUrl.isEmpty()) { // assure that the current index is set on the index that represents // the child URL @@ -380,7 +388,7 @@ void DolphinColumnWidget::activate() selectionModel()->setCurrentIndex(proxyIndex, QItemSelectionModel::Current); } - update(); + updateBackground(); } void DolphinColumnWidget::deactivate() @@ -396,11 +404,8 @@ void DolphinColumnWidget::deactivate() this, SLOT(triggerItem(const QModelIndex&))); } - const QPalette palette = m_view->viewport()->palette(); - viewport()->setPalette(palette); - selectionModel()->clear(); - update(); + updateBackground(); } bool DolphinColumnWidget::isCutItem(const KFileItem& item) const |
