Keep titlebars state (hidden/shown) when switching between layouts

parent a508e86c
......@@ -40,6 +40,11 @@ void HideTitleBars::slotInstallRightClick()
connect(dock, &QDockWidget::dockLocationChanged, pCore->window(), &MainWindow::slotUpdateDockLocation);
connect(dock, &QDockWidget::topLevelChanged, pCore->window(), &MainWindow::updateDockTitleBars);
}
updateTitleBars();
}
void HideTitleBars::updateTitleBars()
{
slotShowTitleBars(KdenliveSettings::showtitlebars());
}
......
......@@ -27,6 +27,10 @@ class HideTitleBars : public QObject
public:
explicit HideTitleBars(QObject *parent = nullptr);
public slots:
/** @brief Correctly hide/show dock widget title bars depending on position (floating, tabbed, docked) */
void updateTitleBars();
private:
QAction *m_switchAction;
......
......@@ -228,6 +228,7 @@ bool LayoutManagement::loadLayout(const QString &layoutId, bool selectButton)
m_containerGrp->setExclusive(true);
}
}
emit updateTitleBars();
return true;
}
......
......@@ -47,6 +47,10 @@ private:
QHBoxLayout *m_containerLayout;
KSelectAction *m_loadLayout;
QList <QAction *> m_layoutActions;
signals:
/** @brief Layout changed, ensure title bars are correctly displayed. */
void updateTitleBars();
};
#endif
......@@ -452,7 +452,8 @@ void MainWindow::init()
auto *scmanager = new ScopeManager(this);
new HideTitleBars(this);
HideTitleBars *titleBars = new HideTitleBars(this);
connect(layoutManager, &LayoutManagement::updateTitleBars, titleBars, &HideTitleBars::updateTitleBars);
new DockAreaOrientationManager(this);
m_extraFactory = new KXMLGUIClient(this);
buildDynamicActions();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment