]> git.sesse.net Git - kdenlive/commitdiff
Fix expansion of clips with subitems (through double click)
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 24 Apr 2010 20:36:23 +0000 (20:36 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 24 Apr 2010 20:36:23 +0000 (20:36 +0000)
svn path=/trunk/kdenlive/; revision=4400

src/projectlistview.cpp

index 432a9e463e89f942fd47e0a941596b955293ae75..02e00f68dde0a9348f30bc85240f5466da004247 100644 (file)
@@ -155,11 +155,17 @@ void ProjectListView::mouseDoubleClickEvent(QMouseEvent * event)
     if (!(item->flags() & Qt::ItemIsDragEnabled)) return;
 
     int column = columnAt(event->pos().x());
-    if (column == 0 && (item->clipType() == SLIDESHOW || item->clipType() == TEXT || item->clipType() == COLOR)) {
+    if (column == 0 && (item->clipType() == SLIDESHOW || item->clipType() == TEXT || item->clipType() == COLOR || it->childCount() > 0)) {
         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())) {
+        if (it->childCount() > 0) {
+            if (offset > event->pos().x()) {
+                it->setExpanded(!it->isExpanded());
+                event->accept();
+                return;
+            }
+        } else if (pix.isNull() || offset < event->pos().x()) {
             QTreeWidget::mouseDoubleClickEvent(event);
             return;
         }