]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackedit.cpp
Images and SVG can now be added in titles through add image...
[kdenlive] / src / effectstackedit.cpp
index b0acd704b9c44a733e0b969f741500d15147d085..361e5f2e64d1a89693872165308e84a9bfcf5589 100644 (file)
@@ -30,7 +30,7 @@
 #include "ui_colorval_ui.h"
 #include "complexparameter.h"
 
-static QMap<QString, QIcon> iconCache;
+QMap<QString, QImage> EffectStackEdit::iconCache;
 
 EffectStackEdit::EffectStackEdit(QFrame* frame, QWidget *parent): QObject(parent) {
     QScrollArea *area;
@@ -64,6 +64,11 @@ EffectStackEdit::EffectStackEdit(QFrame* frame, QWidget *parent): QObject(parent
     wid->show();
 
 }
+
+EffectStackEdit::~EffectStackEdit() {
+    iconCache.clear();
+}
+
 void EffectStackEdit::transferParamDesc(const QDomElement& d, int , int) {
     kDebug() << "in";
     params = d;
@@ -81,10 +86,10 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d, int , int) {
         QString value = pa.attribute("value").isNull() ?
                         pa.attribute("default") : pa.attribute("value");
         if (type == "geometry") {
-            pa.setAttribute("namedesc", "X;Y;W;H");
-            pa.setAttribute("format", "%d,%d:%dx%d");
-            pa.setAttribute("min", "-100;-100;0;0");
-            pa.setAttribute("max", "0;0;100;100");
+            pa.setAttribute("namedesc", "X;Y;W;H;M");
+            pa.setAttribute("format", "%d%,%d%:%d%x%d%:%d%");
+            pa.setAttribute("min", "-200;-20;0;0;0");
+            pa.setAttribute("max", "200;200;100;100;100");
         }
         if (type == "complex") {
             //pa.setAttribute("namedesc",pa.attribute("name"));
@@ -105,12 +110,12 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d, int , int) {
             for (int i = 0;i < lsval->list->count();i++) {
                 QString entry = lsval->list->itemText(i);
                 if (!entry.isEmpty() && (entry.endsWith(".png") || entry.endsWith(".pgm"))) {
-                    if (!iconCache.contains(entry)) {
-                        QPixmap pix(entry);
-                        iconCache[entry] = pix.scaled(30, 30);
+                    if (!EffectStackEdit::iconCache.contains(entry)) {
+                        QImage pix(entry);
+                        EffectStackEdit::iconCache[entry] = pix.scaled(30, 30);
                     }
                     lsval->list->setIconSize(QSize(30, 30));
-                    lsval->list->setItemIcon(i, iconCache[entry]);
+                    lsval->list->setItemIcon(i, QPixmap::fromImage(iconCache[entry]));
                 }
             }
             connect(lsval->list, SIGNAL(currentIndexChanged(int)) , this, SLOT(collectAllParameters()));