]> git.sesse.net Git - kdenlive/commitdiff
Edit clip when double clicking on it's thumbnail in project tree
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 3 Feb 2010 20:19:25 +0000 (20:19 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 3 Feb 2010 20:19:25 +0000 (20:19 +0000)
svn path=/trunk/kdenlive/; revision=4286

src/projectlistview.cpp

index 6d4c61df6e40cce312c30eafaa308719ebce6716..c4b8d4f5ab3b44e90944b5488dcf76139130af98 100644 (file)
@@ -136,9 +136,22 @@ void ProjectListView::mouseDoubleClickEvent(QMouseEvent * event)
     } else item = static_cast <ProjectItem *>(it);
 
     if (!(item->flags() & Qt::ItemIsDragEnabled)) return;
-    if ((columnAt(event->pos().x()) == 0) && (item->clipType() == SLIDESHOW || item->clipType() == TEXT || item->clipType() == COLOR)) QTreeWidget::mouseDoubleClickEvent(event);
-    else if ((columnAt(event->pos().x()) == 1) && it->type() != PROJECTSUBCLIPTYPE) QTreeWidget::mouseDoubleClickEvent(event);
-    else emit showProperties(item->referencedClip());
+
+    int column = columnAt(event->pos().x());
+    if (column == 0 && (item->clipType() == SLIDESHOW || item->clipType() == TEXT || item->clipType() == COLOR)) {
+        QPixmap pix = qVariantValue<QPixmap>(it->data(0, Qt::DecorationRole));
+        int offset = pix.width() + indentation();
+        if (item->parent()) offset += indentation();
+        if ((pix.isNull() || offset < event->pos().x())) {
+            QTreeWidget::mouseDoubleClickEvent(event);
+            return;
+        }
+    }
+    if ((column == 1) && it->type() != PROJECTSUBCLIPTYPE) {
+        QTreeWidget::mouseDoubleClickEvent(event);
+        return;
+    }
+    emit showProperties(item->referencedClip());
 }
 
 // virtual