]> git.sesse.net Git - kdenlive/blobdiff - src/cornerswidget.cpp
Apply patch from P. Fleury to improve jog shuttle speed handling.
[kdenlive] / src / cornerswidget.cpp
index c919ec4aaed5b1100ef7c5de2ca9a5d634a6fb7c..14c43353ef2b1d2c837763d4fc4901d21324c273 100644 (file)
@@ -23,6 +23,7 @@
 #include "monitorscenecontrolwidget.h"
 #include "onmonitoritems/onmonitorcornersitem.h"
 #include "renderer.h"
+#include "kdenlivesettings.h"
 
 #include <QGraphicsView>
 #include <QHBoxLayout>
@@ -48,8 +49,19 @@ CornersWidget::CornersWidget(Monitor* monitor, int clipPos, bool isEffect, int f
 
     m_config = new MonitorSceneControlWidget(m_scene, m_ui.frameConfig);
     QHBoxLayout *layout = new QHBoxLayout(m_ui.frameConfig);
-    layout->addWidget(m_config->getShowHideButton());
+    layout->setContentsMargins(0, 0, 0, 0);
     layout->addWidget(m_config);
+    QHBoxLayout *layout2 = new QHBoxLayout(m_ui.widgetConfigButton);
+    layout2->setContentsMargins(0, 0, 0, 0);
+    layout2->addWidget(m_config->getShowHideButton());
+
+    QToolButton *buttonShowLines = new QToolButton(m_config);
+    // TODO: Better Icon
+    buttonShowLines->setIcon(KIcon("insert-horizontal-rule"));
+    buttonShowLines->setToolTip(i18n("Show/Hide the lines connecting the corners"));
+    buttonShowLines->setCheckable(true);
+    connect(buttonShowLines, SIGNAL(toggled(bool)), this, SLOT(slotShowLines(bool)));
+    m_config->addWidget(buttonShowLines, 0, 2);
 
     int width = m_monitor->render->frameRenderWidth();
     int height = m_monitor->render->renderHeight();
@@ -81,6 +93,11 @@ CornersWidget::CornersWidget(Monitor* monitor, int clipPos, bool isEffect, int f
     connect(m_ui.spinY3, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateItem()));
     connect(m_ui.spinY4, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateItem()));
 
+    connect(m_ui.toolReset1, SIGNAL(clicked()), this, SLOT(slotResetCorner1()));
+    connect(m_ui.toolReset2, SIGNAL(clicked()), this, SLOT(slotResetCorner2()));
+    connect(m_ui.toolReset3, SIGNAL(clicked()), this, SLOT(slotResetCorner3()));
+    connect(m_ui.toolReset4, SIGNAL(clicked()), this, SLOT(slotResetCorner4()));
+
     connect(m_config, SIGNAL(showScene(bool)), this, SLOT(slotShowScene(bool)));
     connect(m_monitor, SIGNAL(renderPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
     connect(m_scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateProperties()));
@@ -195,4 +212,46 @@ void CornersWidget::slotShowScene(bool show)
         slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
 }
 
+void CornersWidget::slotShowLines(bool show)
+{
+    KdenliveSettings::setOnmonitoreffects_cornersshowlines(show);
+    m_item->update();
+}
+
+void CornersWidget::slotResetCorner1()
+{
+    blockSignals(true);
+    m_ui.spinX1->setValue(0);
+    m_ui.spinY1->setValue(0);
+    blockSignals(false);
+    slotUpdateItem();
+}
+
+void CornersWidget::slotResetCorner2()
+{
+    blockSignals(true);
+    m_ui.spinX2->setValue(m_monitor->render->frameRenderWidth());
+    m_ui.spinY2->setValue(0);
+    blockSignals(false);
+    slotUpdateItem();
+}
+
+void CornersWidget::slotResetCorner3()
+{
+    blockSignals(true);
+    m_ui.spinX3->setValue(m_monitor->render->frameRenderWidth());
+    m_ui.spinY3->setValue(m_monitor->render->renderHeight());
+    blockSignals(false);
+    slotUpdateItem();
+}
+
+void CornersWidget::slotResetCorner4()
+{
+    blockSignals(true);
+    m_ui.spinX4->setValue(0);
+    m_ui.spinY4->setValue(m_monitor->render->renderHeight());
+    blockSignals(false);
+    slotUpdateItem();
+}
+
 #include "cornerswidget.moc"