]> git.sur5r.net Git - minitube/commitdiff
16:9 thumbs
authorFlavio <flavio@odisseo.local>
Mon, 28 Jan 2013 11:29:53 +0000 (12:29 +0100)
committerFlavio <flavio@odisseo.local>
Mon, 28 Jan 2013 11:29:53 +0000 (12:29 +0100)
src/playlistitemdelegate.cpp
src/playlistview.cpp
src/ytfeedreader.cpp

index 4cc36f9a5d06f78d406c1a711549c5051d9dbbd4..32048e0d617419c30e0111d7745fc19c7d22396a 100644 (file)
@@ -7,7 +7,7 @@
 #include "video.h"
 
 const qreal PlaylistItemDelegate::THUMB_HEIGHT = 90.0;
-const qreal PlaylistItemDelegate::THUMB_WIDTH = 120.0;
+const qreal PlaylistItemDelegate::THUMB_WIDTH = 160.0;
 const qreal PlaylistItemDelegate::PADDING = 10.0;
 
 QRect lastAuthorRect;
@@ -35,9 +35,11 @@ void PlaylistItemDelegate::createPlayIcon() {
     playIcon.fill(Qt::transparent);
     QPainter painter(&playIcon);
     QPolygon polygon;
-    polygon << QPoint(PADDING*4, PADDING*2)
-            << QPoint(THUMB_WIDTH-PADDING*4, THUMB_HEIGHT/2)
-            << QPoint(PADDING*4, THUMB_HEIGHT-PADDING*2);
+    const int hPadding = PADDING*6;
+    const int vPadding = PADDING*2;
+    polygon << QPoint(hPadding, vPadding)
+            << QPoint(THUMB_WIDTH-hPadding, THUMB_HEIGHT/2)
+            << QPoint(hPadding, THUMB_HEIGHT-vPadding);
     painter.setRenderHints(QPainter::Antialiasing, true);
     painter.setBrush(Qt::white);
     QPen pen;
index 6fe2d66d3603f545219401d94a03b12fe451fb40..d8cbf99df565175607f04fbddd9fced3a3f59f43 100644 (file)
@@ -106,7 +106,7 @@ bool PlaylistView::isHoveringAuthor(QMouseEvent *event) {
 bool PlaylistView::isHoveringThumbnail(QMouseEvent *event) {
     const QModelIndex index = indexAt(event->pos());
     const QRect itemRect = visualRect(index);
-    QRect thumbRect(0, 0, 120, 90);
+    static const QRect thumbRect(0, 0, 160, 90);
     const int x = event->x() - itemRect.x() - thumbRect.x();
     const int y = event->y() - itemRect.y() - thumbRect.y();
     return x > 0 && x < thumbRect.width() && y > 0 && y < thumbRect.height();
index 2551d8426f33656fc53ecb8b4a83f3d45ab00d49..117f92bf891cf5d91a225b8ec0ddd8e135319ce8 100644 (file)
@@ -66,7 +66,7 @@ void YTFeedReader::readEntry() {
                         if (name() == QLatin1String("thumbnail")) {
                             // qDebug() << "Thumb: " << attributes().value("url").toString();
                             QStringRef name = attributes().value("yt:name");
-                            if (name == QLatin1String("default"))
+                            if (name == QLatin1String("mqdefault"))
                                 video->setThumbnailUrl(
                                             attributes().value("url").toString());
                             else if (name == QLatin1String("hqdefault"))