┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphintabpage.cpp
diff options
context:
space:
mode:
authorLuca Beltrame <[email protected]>2017-05-22 23:32:36 +0200
committerLuca Beltrame <[email protected]>2017-05-22 23:32:36 +0200
commit95f9dc9de00e4663ade9506bd1b7b58816d13458 (patch)
tree81f2378b404cc71df2f439beaaf5ac1ad0dd0dba /src/dolphintabpage.cpp
parent588db665365e81d24e31d651f8a776c0bb714e3c (diff)
parent43da84eefc7d68ce86cda2d353216dbe7552fc2c (diff)
Merge branch 'Applications/17.04'
Diffstat (limited to 'src/dolphintabpage.cpp')
-rw-r--r--src/dolphintabpage.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/dolphintabpage.cpp b/src/dolphintabpage.cpp
index 5c42d41ec..1d3a6f08c 100644
--- a/src/dolphintabpage.cpp
+++ b/src/dolphintabpage.cpp
@@ -28,7 +28,8 @@
DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &secondaryUrl, QWidget* parent) :
QWidget(parent),
m_primaryViewActive(true),
- m_splitViewEnabled(false)
+ m_splitViewEnabled(false),
+ m_active(true)
{
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setSpacing(0);
@@ -286,17 +287,31 @@ void DolphinTabPage::restoreStateV1(const QByteArray& state)
m_splitter->restoreState(splitterState);
}
+void DolphinTabPage::setActive(bool active)
+{
+ if (active) {
+ m_active = active;
+ } else {
+ // we should bypass changing active view in split mode
+ m_active = !m_splitViewEnabled;
+ }
+ // we want view to fire activated when goes from false to true
+ activeViewContainer()->setActive(active);
+}
+
void DolphinTabPage::slotViewActivated()
{
const DolphinView* oldActiveView = activeViewContainer()->view();
// Set the view, which was active before, to inactive
- // and update the active view type.
- if (m_splitViewEnabled) {
- activeViewContainer()->setActive(false);
- m_primaryViewActive = !m_primaryViewActive;
- } else {
- m_primaryViewActive = true;
+ // and update the active view type, if tab is active
+ if (m_active) {
+ if (m_splitViewEnabled) {
+ activeViewContainer()->setActive(false);
+ m_primaryViewActive = !m_primaryViewActive;
+ } else {
+ m_primaryViewActive = true;
+ }
}
const DolphinView* newActiveView = activeViewContainer()->view();