]> git.sesse.net Git - kdenlive/blobdiff - src/clipproperties.cpp
Project tree sub-clips and clip properties dialog thumbnails are now created in anoth...
[kdenlive] / src / clipproperties.cpp
index 1d5e39ee5dce7e62cce42b33e7d3b7fee1bf9933..22bc7269baa9513479376c3679698f64386cf507 100644 (file)
@@ -435,21 +435,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg
         if (props.contains("colorspace"))
             new QTreeWidgetItem(m_view.clip_vproperties, QStringList() << i18n("Colorspace") << ProfilesDialog::getColorspaceDescription(props.value("colorspace").toInt()));
         
-
-        int width = 180.0 * KdenliveSettings::project_display_ratio();
-        if (width % 2 == 1) width++;
-        QPixmap pix = m_clip->thumbProducer()->getImage(url, m_clip->getClipThumbFrame(), width, 180);
-       QPixmap framedPix(pix.width(), pix.height());
-       framedPix.fill(Qt::transparent);
-       QPainter p(&framedPix);
-       p.setRenderHint(QPainter::Antialiasing, true);
-       QPainterPath path;
-       path.addRoundedRect(0.5, 0.5, framedPix.width() - 1, framedPix.height() - 1, 4, 4);
-       p.setClipPath(path);
-       p.drawPixmap(0, 0, pix);
-       p.end();
-       
-        m_view.clip_thumb->setPixmap(framedPix);
+       m_view.clip_thumb->setMinimumSize(180 * KdenliveSettings::project_display_ratio(), 180);
+        
         if (t == IMAGE || t == VIDEO || t == PLAYLIST) m_view.tabWidget->removeTab(AUDIOTAB);
     } else {
         m_view.tabWidget->removeTab(IMAGETAB);
@@ -688,6 +675,21 @@ ClipProperties::~ClipProperties()
     if (del2) delete del2;
 }
 
+void ClipProperties::slotGotThumbnail(const QString &id, QImage img)
+{
+    if (id != m_clip->getId()) return;
+    QPixmap framedPix(img.width(), img.height());
+    framedPix.fill(Qt::transparent);
+    QPainter p(&framedPix);
+    p.setRenderHint(QPainter::Antialiasing, true);
+    QPainterPath path;
+    path.addRoundedRect(0.5, 0.5, framedPix.width() - 1, framedPix.height() - 1, 4, 4);
+    p.setClipPath(path);
+    p.drawImage(0, 0, img);
+    p.end();
+    m_view.clip_thumb->setPixmap(framedPix);
+}
+
 void ClipProperties::slotApplyProperties()
 {
     if (m_clip != NULL) {