┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphintabwidget.cpp
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <[email protected]>2016-12-17 14:23:20 +0100
committerMartin T. H. Sandsmark <[email protected]>2016-12-28 13:49:37 +0100
commit6af0dad2eeba82929c2299f66ea81e5d0140a251 (patch)
tree52ba7efab37b6ae293e0e1a796b8df7697a7217f /src/dolphintabwidget.cpp
parentae935d36b1565dd9a763f022caac5863071711fa (diff)
Fix updating of new item menu when changing tabs
Correctly set the active status of views when changing tabs. Before: Right click in home folder, see create new enabled, open tab, go to /usr, right click and see it is disabled, switch back to first tab and right click, and it is still disabled. After: It is enabled and disabled as appropriate when switching tab. REVIEW: 129664
Diffstat (limited to 'src/dolphintabwidget.cpp')
-rw-r--r--src/dolphintabwidget.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp
index 22674d1bd..bcd4a49fd 100644
--- a/src/dolphintabwidget.cpp
+++ b/src/dolphintabwidget.cpp
@@ -32,7 +32,8 @@
DolphinTabWidget::DolphinTabWidget(QWidget* parent) :
QTabWidget(parent),
- m_placesSelectorVisible(true)
+ m_placesSelectorVisible(true),
+ m_previousTab(-1)
{
connect(this, &DolphinTabWidget::tabCloseRequested,
this, static_cast<void (DolphinTabWidget::*)(int)>(&DolphinTabWidget::closeTab));
@@ -304,9 +305,15 @@ void DolphinTabWidget::tabUrlChanged(const QUrl& url)
void DolphinTabWidget::currentTabChanged(int index)
{
DolphinViewContainer* viewContainer = tabPageAt(index)->activeViewContainer();
+ viewContainer->setActive(true);
emit activeViewChanged(viewContainer);
emit currentUrlChanged(viewContainer->url());
viewContainer->view()->setFocus();
+
+ if (tabPageAt(m_previousTab)) {
+ tabPageAt(m_previousTab)->activeViewContainer()->setActive(false);
+ }
+ m_previousTab = index;
}
void DolphinTabWidget::tabInserted(int index)