painter->drawPixmap(playIcon.rect(), playIcon);
// time
- drawTime(painter, video->formattedDuration(), line);
+ if (video->duration() > 0)
+ drawTime(painter, video->formattedDuration(), line);
// separator
painter->setPen(option.palette.color(QPalette::Midlight));
if (line.width() > THUMB_WIDTH + 60) {
- if (isActive) painter->setFont(boldFont);
+ // if (isActive) painter->setFont(boldFont);
// text color
if (isSelected)
else
painter->setOpacity(.5);
}
- QString authorString = video->author();
+ QString authorString = video->channelTitle();
textLoc.setX(textLoc.x() + stringSize.width() + PADDING);
stringSize = QSize(QFontMetrics(painter->font()).size( Qt::TextSingleLine, authorString ) );
QRect authorTextBox(textLoc , stringSize);
}
if (downloadInfo) {
- QString definitionString = VideoDefinition::getDefinitionName(video->getDefinitionCode());
+ const QString definitionString = VideoDefinition::getDefinitionFor(video->getDefinitionCode()).getName();
textLoc.setX(textLoc.x() + stringSize.width() + PADDING);
stringSize = QSize(QFontMetrics(painter->font()).size( Qt::TextSingleLine, definitionString ) );
QRect viewCountTextBox(textLoc , stringSize);
} else {
- bool isHovered = option.state & QStyle::State_MouseOver;
+ const bool isHovered = index.data(HoveredItemRole).toBool();
if (!isActive && isHovered) {
painter->setFont(smallerFont);
painter->setPen(Qt::white);