X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/fb4b4465f91581dac6a876568ba21ed67ec918bc..60d6a3bdbcd44360e1c6ae1c82239ecf6d60ded7:/src/views/dolphinview.cpp diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 7eb4d2454..5b00fa36d 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -97,7 +97,7 @@ DolphinView::DolphinView(const QUrl& url, QWidget* parent) : { m_topLayout = new QVBoxLayout(this); m_topLayout->setSpacing(0); - m_topLayout->setMargin(0); + m_topLayout->setContentsMargins(0, 0, 0, 0); // When a new item has been created by the "Create New..." menu, the item should // get selected and it must be assured that the item will get visible. As the @@ -709,7 +709,7 @@ void DolphinView::stopLoading() void DolphinView::updatePalette() { - QColor color = KColorScheme(QPalette::Active, KColorScheme::View).background().color(); + QColor color = KColorScheme(isActiveWindow() ? QPalette::Active : QPalette::Inactive, KColorScheme::View).background().color(); if (!m_active) { color.setAlpha(150); } @@ -738,6 +738,11 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event) QPixmapCache::clear(); break; + case QEvent::WindowActivate: + case QEvent::WindowDeactivate: + updatePalette(); + break; + case QEvent::KeyPress: if (GeneralSettings::useTabForSwitchingSplitView()) { QKeyEvent* keyEvent = static_cast(event); @@ -848,7 +853,7 @@ void DolphinView::slotItemsActivated(const KItemSet& indexes) const QUrl& url = openItemAsFolderUrl(item); if (!url.isEmpty()) { // Open folders in new tabs - emit tabRequested(url); + emit tabRequested(url, DolphinTabWidget::AfterLastTab); } else { items.append(item); } @@ -866,9 +871,9 @@ void DolphinView::slotItemMiddleClicked(int index) const KFileItem& item = m_model->fileItem(index); const QUrl& url = openItemAsFolderUrl(item); if (!url.isEmpty()) { - emit tabRequested(url); + emit tabRequested(url, DolphinTabWidget::AfterCurrentTab); } else if (isTabsForFilesEnabled()) { - emit tabRequested(item.url()); + emit tabRequested(item.url(), DolphinTabWidget::AfterCurrentTab); } }