]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Fix ascending/descending choosers getting unchecked when re-selecting the same sort...
[dolphin.git] / src / views / dolphinview.cpp
index 7eb4d24546ecf69140a12fa7b6a74958fb8262f6..5b00fa36dcceefb6ca1b35f350e16512d1281f77 100644 (file)
@@ -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<QKeyEvent*>(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);
     }
 }