]> git.sesse.net Git - kdenlive/commitdiff
Allow setting rescale to a custom percentage value in composite transition
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 13 Apr 2009 13:27:07 +0000 (13:27 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 13 Apr 2009 13:27:07 +0000 (13:27 +0000)
svn path=/trunk/kdenlive/; revision=3292

src/geometryval.cpp
src/geometryval.h

index a58fdfd0cd6cff208b7307d8abbb8dd19685066a..4ab9b458b583b36105c9d283e86e4488dc4ca6bc 100644 (file)
@@ -25,6 +25,7 @@
 #include <QVBoxLayout>
 #include <QGraphicsRectItem>
 #include <QMenu>
+#include <QInputDialog>
 
 
 Geometryval::Geometryval(const MltVideoProfile profile, QWidget* parent) :
@@ -78,6 +79,7 @@ Geometryval::Geometryval(const MltVideoProfile profile, QWidget* parent) :
     m_scaleMenu->addAction(i18n("50%"), this, SLOT(slotResize50()));
     m_scaleMenu->addAction(i18n("100%"), this, SLOT(slotResize100()));
     m_scaleMenu->addAction(i18n("200%"), this, SLOT(slotResize200()));
+    m_scaleMenu->addAction(i18n("Custom"), this, SLOT(slotResizeCustom()));
 
 
     m_alignMenu = new QMenu(i18n("Align..."), this);
@@ -239,6 +241,23 @@ void Geometryval::slotResize200()
     slotUpdateTransitionProperties();
 }
 
+void Geometryval::slotResizeCustom()
+{
+    int pos = m_ui.spinPos->value();
+    Mlt::GeometryItem item;
+    int error = m_geom->fetch(&item, pos);
+    if (error || item.key() == false) {
+        // no keyframe under cursor
+        return;
+    }
+    int scale = m_paramRect->rect().width() * 100 / m_profile.width;
+    bool ok;
+    scale =  QInputDialog::getInt(this, i18n("Resize..."), i18n("Scale"), scale, 1, 2147483647, 10, &ok);
+    if (!ok) return;
+    m_paramRect->setRect(0, 0, m_profile.width * scale / 100, m_profile.height * scale / 100);
+    slotUpdateTransitionProperties();
+}
+
 void Geometryval::slotTransparencyChanged(int transp)
 {
     int pos = m_ui.spinPos->value();
index 8623a7517f6c90c79aa62336a60cdbdb32ad4e11..172f78887e391f0912a79bd39122dec1bc0b4c30 100644 (file)
@@ -72,6 +72,7 @@ private slots:
     void slotResize50();
     void slotResize100();
     void slotResize200();
+    void slotResizeCustom();
     void slotAlignRight();
     void slotAlignLeft();
     void slotAlignTop();