aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-07-10 23:21:20 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-07-10 23:21:20 +0200
commitad250f49f13aeebc4458229ba4acaa21bd14991d (patch)
tree89d21464aa61891acf3f05e9aae056d097469c8c
parentf73c65b572531c2d0b01cd824131dc93e60257d7 (diff)
Fix dock widget title bar inconsistencies
-rw-r--r--src/hidetitlebars.cpp10
-rw-r--r--src/mainwindow.cpp7
-rw-r--r--src/mainwindow.h2
3 files changed, 9 insertions, 10 deletions
diff --git a/src/hidetitlebars.cpp b/src/hidetitlebars.cpp
index 342fc19..ae5367c 100644
--- a/src/hidetitlebars.cpp
+++ b/src/hidetitlebars.cpp
@@ -23,9 +23,6 @@ HideTitleBars::HideTitleBars(QObject* parent) :
m_switchAction->setChecked(KdenliveSettings::showtitlebars());
pCore->window()->addAction(QStringLiteral("show_titlebars"), m_switchAction);
connect(m_switchAction, SIGNAL(triggered(bool)), SLOT(slotShowTitleBars(bool)));
-
- slotShowTitleBars(KdenliveSettings::showtitlebars());
-
connect(pCore->window(), SIGNAL(GUISetupDone()), SLOT(slotInstallRightClick()));
}
@@ -36,17 +33,16 @@ void HideTitleBars::slotInstallRightClick()
tabs.at(i)->setContextMenuPolicy(Qt::CustomContextMenu);
connect(tabs.at(i), SIGNAL(customContextMenuRequested(QPoint)), SLOT(slotSwitchTitleBars()));
}
- pCore->window()->updateDockTitleBars();
+ slotShowTitleBars(KdenliveSettings::showtitlebars());
}
void HideTitleBars::slotShowTitleBars(bool show)
{
- return;
QList <QDockWidget *> docks = pCore->window()->findChildren<QDockWidget *>();
for (int i = 0; i < docks.count(); ++i) {
QDockWidget* dock = docks.at(i);
+ QWidget *bar = dock->titleBarWidget();
if (show) {
- QWidget *bar = dock->titleBarWidget();
if (dock->isFloating()) {
if (bar) {
dock->setTitleBarWidget(0);
@@ -90,7 +86,7 @@ void HideTitleBars::slotShowTitleBars(bool show)
}
#endif
} else {
- if (!dock->isFloating() && !dock->titleBarWidget()) {
+ if (!dock->isFloating() && !bar) {
dock->setTitleBarWidget(new QWidget);
}
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 856884c..dd4072c 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -647,9 +647,9 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
KdenliveSettings::setDecklink_extension(data.section(';', 1, 1));
}
}
- emit GUISetupDone();
pCore->projectManager()->init(Url, clipsToLoad);
QTimer::singleShot(0, pCore->projectManager(), SLOT(slotLoadOnOpen()));
+ QTimer::singleShot(0, this, SIGNAL(GUISetupDone()));
connect(this, SIGNAL(reloadTheme()), this, SLOT(slotReloadTheme()), Qt::UniqueConnection);
#ifdef USE_JOGSHUTTLE
@@ -3522,6 +3522,7 @@ QDockWidget *MainWindow::addDock(const QString &title, const QString &objectName
dockWidget->setWidget(widget);
addDockWidget(area, dockWidget);
connect(dockWidget, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), this, SLOT(updateDockTitleBars()));
+ connect(dockWidget, SIGNAL(topLevelChanged(bool)), this, SLOT(updateDockTitleBars(bool)));
return dockWidget;
}
@@ -3567,8 +3568,10 @@ bool MainWindow::isTabbedWith(QDockWidget *widget, const QString & otherWidget)
return false;
}
-void MainWindow::updateDockTitleBars()
+void MainWindow::updateDockTitleBars(bool isTopLevel)
{
+ if (!KdenliveSettings::showtitlebars() || !isTopLevel)
+ return;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
QList <QDockWidget *> docks = pCore->window()->findChildren<QDockWidget *>();
for (int i = 0; i < docks.count(); ++i) {
diff --git a/src/mainwindow.h b/src/mainwindow.h
index d45458e..ecf4df6 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -258,7 +258,7 @@ public slots:
void slotTimelineClipSelected(ClipItem* item, bool reloadStack = true, bool raise = true);
/** @brief Reload project profile in config dialog if changed. */
void slotRefreshProfiles();
- void updateDockTitleBars();
+ void updateDockTitleBars(bool isTopLevel = true);
void configureToolbars();
private slots: