]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Spacer tool (can only add space for the moment)
[kdenlive] / src / mainwindow.cpp
index 1e0e7db13054f7d8244de24ce137f12a4f7c5f52..3ffe22e7af2eddf1730a3893b898283851f75643 100644 (file)
@@ -542,8 +542,14 @@ void MainWindow::setupActions() {
     m_buttonRazorTool->setCheckable(true);
     m_buttonRazorTool->setChecked(false);
 
+    m_buttonSpacerTool = new KAction(KIcon("kdenlive-spacer-tool"), i18n("Spacer tool"), this);
+    toolbar->addAction(m_buttonSpacerTool);
+    m_buttonSpacerTool->setCheckable(true);
+    m_buttonSpacerTool->setChecked(false);
+
     m_toolGroup->addAction(m_buttonSelectTool);
     m_toolGroup->addAction(m_buttonRazorTool);
+    m_toolGroup->addAction(m_buttonSpacerTool);
     m_toolGroup->setExclusive(true);
     toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly);
 
@@ -556,6 +562,10 @@ void MainWindow::setupActions() {
     actionWidget->setMaximumWidth(24);
     actionWidget->setMinimumHeight(17);
 
+    actionWidget = toolbar->widgetForAction(m_buttonSpacerTool);
+    actionWidget->setMaximumWidth(24);
+    actionWidget->setMinimumHeight(17);
+
     toolbar->setStyleSheet(style1);
     connect(m_toolGroup, SIGNAL(triggered(QAction *)), this, SLOT(slotChangeTool(QAction *)));
 
@@ -644,6 +654,7 @@ void MainWindow::setupActions() {
 
     collection->addAction("select_tool", m_buttonSelectTool);
     collection->addAction("razor_tool", m_buttonRazorTool);
+    collection->addAction("spacer_tool", m_buttonSpacerTool);
 
     collection->addAction("show_video_thumbs", m_buttonVideoThumbs);
     collection->addAction("show_audio_thumbs", m_buttonAudioThumbs);
@@ -1661,6 +1672,7 @@ void MainWindow::slotClipEnd() {
 void MainWindow::slotChangeTool(QAction * action) {
     if (action == m_buttonSelectTool) slotSetTool(SELECTTOOL);
     else if (action == m_buttonRazorTool) slotSetTool(RAZORTOOL);
+    else if (action == m_buttonSpacerTool) slotSetTool(SPACERTOOL);
 }
 
 void MainWindow::slotSetTool(PROJECTTOOL tool) {