]> git.sesse.net Git - kdenlive/blobdiff - src/simplekeyframes/simplekeyframewidget.cpp
rotoscoping: Update add/delete keyframe button when timeline cursor is at keyframe
[kdenlive] / src / simplekeyframes / simplekeyframewidget.cpp
index d600e3b0257f5628c2aa238f7f2c006dffe8b1df..1ae3bdf68fe022174a357bdbeb8c02e4073d3377 100644 (file)
@@ -62,6 +62,7 @@ SimpleKeyframeWidget::SimpleKeyframeWidget(Timecode t, int duration, QWidget *pa
 
     connect(m_time, SIGNAL(editingFinished()), this, SLOT(slotSetPosition()));
     connect(m_timeline, SIGNAL(positionChanged(int)), this, SLOT(slotSetPosition(int)));
+    connect(m_timeline, SIGNAL(atKeyframe(bool)), this, SLOT(slotAtKeyframe(bool)));
     connect(m_timeline, SIGNAL(keyframeAdded(int)), this, SIGNAL(keyframeAdded(int)));
     connect(m_timeline, SIGNAL(keyframeRemoved(int)), this, SIGNAL(keyframeRemoved(int)));
     connect(m_timeline, SIGNAL(keyframeMoved(int,int)), this, SIGNAL(keyframeMoved(int,int)));
@@ -117,4 +118,15 @@ void SimpleKeyframeWidget::updateTimecodeFormat()
     m_time->slotUpdateTimeCodeFormat();
 }
 
+void SimpleKeyframeWidget::slotAtKeyframe(bool atKeyframe)
+{
+    if (atKeyframe) {
+        m_buttonAddDelete->setIcon(KIcon("edit-delete"));
+        m_buttonAddDelete->setToolTip(i18n("Delete keyframe"));
+    } else {
+        m_buttonAddDelete->setIcon(KIcon("document-new"));
+        m_buttonAddDelete->setToolTip(i18n("Add keyframe"));
+    }
+}
+
 #include "simplekeyframewidget.moc"