]> git.sur5r.net Git - minitube/commitdiff
Prettier playlist borders
authorFlavio Tordini <flavio.tordini@gmail.com>
Wed, 4 Nov 2009 23:34:49 +0000 (00:34 +0100)
committerFlavio Tordini <flavio.tordini@gmail.com>
Wed, 4 Nov 2009 23:34:49 +0000 (00:34 +0100)
Don't draw time when there's no thumb

src/playlist/PrettyItemDelegate.cpp

index c916d0d5c8f159e8c032fbb9599780bd156f564c..5c55ebfe1b017b846a579e9f4e9e89c857c8792a 100644 (file)
@@ -89,16 +89,17 @@ void PrettyItemDelegate::paintBody( QPainter* painter,
         // play icon overlayed on the thumb
         if (isActive)
             paintPlayIcon(painter);
-    }
 
-    // time
-    QString timeString;
-    int duration = video->duration();
-    if ( duration > 3600 )
-        timeString = QTime().addSecs(duration).toString("h:mm:ss");
-    else
-        timeString = QTime().addSecs(duration).toString("m:ss");
-    drawTime(painter, timeString, line);
+        // time
+        QString timeString;
+        int duration = video->duration();
+        if ( duration > 3600 )
+            timeString = QTime().addSecs(duration).toString("h:mm:ss");
+        else
+            timeString = QTime().addSecs(duration).toString("m:ss");
+        drawTime(painter, timeString, line);
+
+    }
 
     if (isActive) painter->setFont(boldFont);
     const QFontMetricsF fm(painter->font());
@@ -164,7 +165,10 @@ void PrettyItemDelegate::paintBody( QPainter* painter,
 
     // separator
     painter->setPen(option.palette.color(QPalette::Midlight));
-    painter->drawLine(0, THUMB_HEIGHT, line.width(), THUMB_HEIGHT);
+    painter->drawLine(THUMB_WIDTH, THUMB_HEIGHT, line.width(), THUMB_HEIGHT);
+    if (!video->thumbnail().isNull())
+        painter->setPen(Qt::black);
+    painter->drawLine(0, THUMB_HEIGHT, THUMB_WIDTH, THUMB_HEIGHT);
 
     painter->restore();