]> git.sesse.net Git - kdenlive/blobdiff - src/cornerswidget.cpp
Revert "Drop support for KDE 4.3."
[kdenlive] / src / cornerswidget.cpp
index 46f2a1336131621ccf160432f3a63f8f5b2c79f1..6582c5b0e80168b72f6af06626e3a68c64a1392e 100644 (file)
@@ -46,31 +46,19 @@ CornersWidget::CornersWidget(Monitor *monitor, QDomElement e, int minFrame, int
     edit->showVisibilityButton(true);
     m_scene = edit->getScene();
 
-    m_item = new OnMonitorCornersItem(m_scene);
+    m_item = new OnMonitorCornersItem();
     m_scene->addItem(m_item);
 
     // TODO: Better Icons
-    QToolButton *buttonShowControls = new QToolButton();
-    buttonShowControls->setIcon(KIcon("transform-move"));
-    buttonShowControls->setToolTip(i18n("Show additional controls"));
-    buttonShowControls->setCheckable(true);
-    buttonShowControls->setAutoRaise(true);
-    buttonShowControls->setChecked(KdenliveSettings::onmonitoreffects_cornersshowcontrols());
-    connect(buttonShowControls, SIGNAL(toggled(bool)), this, SLOT(slotShowControls(bool)));
-    edit->addCustomControl(buttonShowControls);
-
-    QToolButton *buttonShowLines = new QToolButton();
-    buttonShowLines->setIcon(KIcon("insert-horizontal-rule"));
-    buttonShowLines->setToolTip(i18n("Show/Hide the lines connecting the corners"));
-    buttonShowLines->setCheckable(true);
-    buttonShowControls->setAutoRaise(true);
-    buttonShowLines->setChecked(KdenliveSettings::onmonitoreffects_cornersshowlines());
-    connect(buttonShowLines, SIGNAL(toggled(bool)), this, SLOT(slotShowLines(bool)));
-    edit->addCustomControl(buttonShowLines);
+    edit->removeCustomControls();
+    edit->addCustomButton(KIcon("transform-move"), i18n("Show additional controls"), this, SLOT(slotShowControls(bool)),
+                          true, KdenliveSettings::onmonitoreffects_cornersshowcontrols());
+    edit->addCustomButton(KIcon("insert-horizontal-rule"), i18n("Show/Hide the lines connecting the corners"), this, SLOT(slotShowLines(bool)),
+                          true, KdenliveSettings::onmonitoreffects_cornersshowlines());
 
     connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
     connect(m_monitor, SIGNAL(renderPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
-    connect(m_scene, SIGNAL(actionFinished()), this, SLOT(slotUpdateProperties()));
+    connect(m_item, SIGNAL(changed()), this, SLOT(slotUpdateProperties()));
     connect(m_scene, SIGNAL(addKeyframe()), this, SLOT(slotInsertKeyframe()));
 
     connect(keyframe_list, SIGNAL(cellChanged(int, int)), this, SLOT(slotUpdateItem()));
@@ -209,8 +197,8 @@ void CornersWidget::slotSyncPosition(int relTimelinePos)
 {
     if (keyframe_list->rowCount()) {
         relTimelinePos = qBound(0, relTimelinePos, m_max);
-        if (relTimelinePos != m_pos) {
-            m_pos = relTimelinePos;
+        if (relTimelinePos != m_pos - m_min) {
+            m_pos = relTimelinePos + m_min;
             slotUpdateItem();
         }
     }