#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;
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;
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();
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"))