]> git.sesse.net Git - kdenlive/commitdiff
Add option to hide dock widget title bars:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 7 Apr 2010 17:48:12 +0000 (17:48 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 7 Apr 2010 17:48:12 +0000 (17:48 +0000)
http://kdenlive.org/forum/optimize-ui-screen-space-usage

svn path=/trunk/kdenlive/; revision=4373

src/kdenlivesettings.kcfg
src/kdenliveui.rc
src/mainwindow.cpp
src/mainwindow.h

index f4d35385500c598e08ab73fab47224d4c3c51074..a2a6dcc501d46bf195fbff6bea7b532d4142b958 100644 (file)
       <label>Show thumbnails in slideshow dialog.</label>
       <default>false</default>
     </entry>
+    <entry name="showtitlebars" type="Bool">
+      <label>Show dock widget titlebars to allow un/docking.</label>
+      <default>true</default>
+    </entry>    
   </group>
 </kcfg>
index fa83cb678d4ec4996464a6b7fef4fe859be755e4..96a023075980a56e6bcb1e1609408efeb53986c0 100644 (file)
       <Action name="insert_timeline" />
     </Menu>
     <Menu name="dockwindows" ><text>View</text>
+      <Action name="show_titlebars" />
       <Action name="maximize_current" />
       <Action name="show_timeline" />
     </Menu>
index d64ba1d29aaee2be912c907a5452d62b6ee748f0..bc9eb18351d7987302e158e7958cf2c8ca2c848a 100644 (file)
@@ -244,8 +244,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, QWidget *parent
     tabifyDockWidget(m_clipMonitorDock, m_recMonitorDock);
 #endif
     setCentralWidget(m_timelineArea);
-
-
     setupGUI();
 
     /*ScriptingPart* sp = new ScriptingPart(this, QStringList());
@@ -1269,6 +1267,12 @@ void MainWindow::setupActions()
     showTimeline->setChecked(true);
     connect(showTimeline, SIGNAL(triggered(bool)), this, SLOT(slotShowTimeline(bool)));
 
+    QAction *showTitleBar = new KAction(i18n("Show Title Bars"), this);
+    collection->addAction("show_titlebars", showTitleBar);
+    showTitleBar->setCheckable(true);
+    connect(showTitleBar, SIGNAL(triggered(bool)), this, SLOT(slotShowTitleBars(bool)));
+    showTitleBar->setChecked(KdenliveSettings::showtitlebars());
+
     /*QAction *maxCurrent = new KAction(i18n("Maximize Current Widget"), this);
     collection->addAction("maximize_current", maxCurrent);
     maxCurrent->setCheckable(true);
@@ -3332,5 +3336,29 @@ void MainWindow::slotDeleteProjectClips(QStringList ids, QMap<QString, QString>
 
 }
 
+void MainWindow::slotShowTitleBars(bool show)
+{
+    if (show) {
+        m_effectStackDock->setTitleBarWidget(0);
+        m_clipMonitorDock->setTitleBarWidget(0);
+        m_projectMonitorDock->setTitleBarWidget(0);
+        m_recMonitorDock->setTitleBarWidget(0);
+        m_effectListDock->setTitleBarWidget(0);
+        m_transitionConfigDock->setTitleBarWidget(0);
+        m_projectListDock->setTitleBarWidget(0);
+        m_undoViewDock->setTitleBarWidget(0);
+    } else {
+        m_effectStackDock->setTitleBarWidget(new QWidget(this));
+        m_clipMonitorDock->setTitleBarWidget(new QWidget(this));
+        m_projectMonitorDock->setTitleBarWidget(new QWidget(this));
+        m_recMonitorDock->setTitleBarWidget(new QWidget(this));
+        m_effectListDock->setTitleBarWidget(new QWidget(this));
+        m_transitionConfigDock->setTitleBarWidget(new QWidget(this));
+        m_projectListDock->setTitleBarWidget(new QWidget(this));
+        m_undoViewDock->setTitleBarWidget(new QWidget(this));
+    }
+    KdenliveSettings::setShowtitlebars(show);
+}
+
 #include "mainwindow.moc"
 
index 3c79f9e232312c96e3dd80d99a885197acf661c7..b509bedaf99f2400f556ddbf8b0a16bb1faa7fb6 100644 (file)
@@ -344,6 +344,7 @@ private slots:
     void slotInsertZoneToTree();
     void slotInsertZoneToTimeline();
     void slotDeleteProjectClips(QStringList ids, QMap<QString, QString> folderids);
+    void slotShowTitleBars(bool show);
 
 signals:
     Q_SCRIPTABLE void abortRenderJob(const QString &url);