Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix docked widgets losing title and decoration when undocked

parent e45fe2f5
......@@ -240,7 +240,6 @@ void MainWindow::init()
setupActions();
QDockWidget *libraryDock = addDock(i18n("Library"), QStringLiteral("library"), pCore->library());
QDockWidget *mixerDock = addDock(i18n("Audio Mixer"), QStringLiteral("mixer"), pCore->mixer());
m_clipMonitor = new Monitor(Kdenlive::ClipMonitor, pCore->monitorManager(), this);
......@@ -278,7 +277,7 @@ void MainWindow::init()
m_timelineTabs = new TimelineTabs(this);
ctnLay->addWidget(m_timelineTabs);
// Screen grab widget
QWidget *grabWidget = new QWidget(this);
QVBoxLayout *grabLayout = new QVBoxLayout;
......@@ -3397,17 +3396,20 @@ QDockWidget *MainWindow::addDock(const QString &title, const QString &objectName
dockWidget->setObjectName(objectName);
dockWidget->setWidget(widget);
addDockWidget(area, dockWidget);
connect(dockWidget, &QDockWidget::dockLocationChanged, this, [this](Qt::DockWidgetArea dockLocationArea) {
if (dockLocationArea == Qt::NoDockWidgetArea) {
updateDockTitleBars(false);
} else {
updateDockTitleBars(true);
}
});
connect(dockWidget, &QDockWidget::dockLocationChanged, this, &MainWindow::slotUpdateDockLocation);
connect(dockWidget, &QDockWidget::topLevelChanged, this, &MainWindow::updateDockTitleBars);
return dockWidget;
}
void MainWindow::slotUpdateDockLocation(Qt::DockWidgetArea dockLocationArea)
{
if (dockLocationArea == Qt::NoDockWidgetArea) {
updateDockTitleBars(false);
} else {
updateDockTitleBars(true);
}
}
void MainWindow::slotUpdateMonitorOverlays(int id, int code)
{
QMenu *monitorOverlay = static_cast<QMenu *>(factory()->container(QStringLiteral("monitor_config_overlay"), this));
......@@ -3462,11 +3464,13 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
if (!KdenliveSettings::showtitlebars() || !isTopLevel) {
return;
}
QList<QDockWidget *> docks = pCore->window()->findChildren<QDockWidget *>();
QList<QDockWidget *> docks = findChildren<QDockWidget *>();
//qDebug()<<"=== FOUND DOCKS: "<<docks.count();
for (int i = 0; i < docks.count(); ++i) {
QDockWidget *dock = docks.at(i);
QWidget *bar = dock->titleBarWidget();
if (dock->isFloating()) {
//qDebug()<<"==== FOUND FLOATING: "<<dock->objectName();
if (bar) {
dock->setTitleBarWidget(nullptr);
delete bar;
......
......@@ -283,6 +283,8 @@ private slots:
/** @brief Shows the shortcut dialog. */
void slotEditKeys();
void loadDockActions();
/** @brief Add/remove Dock tile bar depending on state (tabbed, floating, ...) */
void slotUpdateDockLocation(Qt::DockWidgetArea dockLocationArea);
/** @brief Reflects setting changes to the GUI. */
void updateConfiguration();
void slotConnectMonitors();
......
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