]> git.sesse.net Git - kdenlive/blobdiff - src/projectlist.cpp
Title clips now really usable (only transparency & duration change still missing)
[kdenlive] / src / projectlist.cpp
index cee7dbd01f773532314cb3a421936e536929c623..33678dc94db2a50f3eeffd942d6b7b21483bd665 100644 (file)
@@ -23,6 +23,7 @@
 #include <QPixmap>
 #include <QIcon>
 #include <QDialog>
+#include <QtGui>
 
 #include <KDebug>
 #include <KAction>
@@ -46,8 +47,8 @@
 #include "docclipbase.h"
 #include "kdenlivedoc.h"
 #include "renderer.h"
+#include "kthumb.h"
 #include "projectlistview.h"
-#include <QtGui>
 
 ProjectList::ProjectList(QWidget *parent)
         : QWidget(parent), m_render(NULL), m_fps(-1), m_commandStack(NULL) {
@@ -465,6 +466,15 @@ QDomElement ProjectList::producersList() {
     return prods;
 }
 
+void ProjectList::slotRefreshClipThumbnail(int clipId) {
+    ProjectItem *item = getItemById(clipId);
+    if (item) {
+        int height = 40;
+        int width = (int)(height  * (double) m_render->renderWidth() / m_render->renderHeight());
+        QPixmap pix = KThumb::getImage(item->clipUrl(), item->referencedClip()->getProjectThumbFrame(), width, height);
+        item->setIcon(0, pix);
+    }
+}
 
 void ProjectList::slotReplyGetFileProperties(int clipId, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata) {
     ProjectItem *item = getItemById(clipId);
@@ -475,8 +485,6 @@ void ProjectList::slotReplyGetFileProperties(int clipId, const QMap < QString, Q
     }
 }
 
-
-
 void ProjectList::slotReplyGetImage(int clipId, int pos, const QPixmap &pix, int w, int h) {
     ProjectItem *item = getItemById(clipId);
     if (item) item->setIcon(0, pix);