From 5ea4e2debc3e96b6e4e8aed0200c53ec4099f67a Mon Sep 17 00:00:00 2001 From: Flavio Date: Mon, 28 Jan 2013 12:29:53 +0100 Subject: [PATCH] 16:9 thumbs --- src/playlistitemdelegate.cpp | 10 ++++++---- src/playlistview.cpp | 2 +- src/ytfeedreader.cpp | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/playlistitemdelegate.cpp b/src/playlistitemdelegate.cpp index 4cc36f9..32048e0 100644 --- a/src/playlistitemdelegate.cpp +++ b/src/playlistitemdelegate.cpp @@ -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; diff --git a/src/playlistview.cpp b/src/playlistview.cpp index 6fe2d66..d8cbf99 100644 --- a/src/playlistview.cpp +++ b/src/playlistview.cpp @@ -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(); diff --git a/src/ytfeedreader.cpp b/src/ytfeedreader.cpp index 2551d84..117f92b 100644 --- a/src/ytfeedreader.cpp +++ b/src/ytfeedreader.cpp @@ -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")) -- 2.39.5