1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

PluginListDelegate: Don't show version of plugin

It is still displayed in tooltip.
This commit is contained in:
David Rosca 2018-03-03 12:32:57 +01:00
parent 72b4cf55ff
commit 63cf3dbade
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -89,19 +89,10 @@ void PluginListDelegate::paint(QPainter* painter, const QStyleOptionViewItem &op
const QString name = index.data(Qt::DisplayRole).toString();
const int leftTitleEdge = leftPosition + 2;
const int rightTitleEdge = rightPosition - m_padding;
const int leftPosForVersion = titleMetrics.width(name) + m_padding;
QRect nameRect(leftTitleEdge, opt.rect.top() + m_padding, rightTitleEdge - leftTitleEdge, titleMetrics.height());
painter->setFont(titleFont);
style->drawItemText(painter, nameRect, Qt::AlignLeft, textPalette, true, name, colorRole);
// Draw version
const QString version = index.data(Qt::UserRole).toString();
QRect versionRect(nameRect.x() + leftPosForVersion, nameRect.y(), rightTitleEdge - leftPosForVersion, titleMetrics.height());
QFont versionFont = titleFont;
versionFont.setBold(false);
painter->setFont(versionFont);
style->drawItemText(painter, versionRect, Qt::AlignLeft, textPalette, true, version, colorRole);
// Draw description
const int descriptionYPos = nameRect.bottom() + opt.fontMetrics.leading();
QRect descriptionRect(nameRect.x(), descriptionYPos, nameRect.width(), opt.fontMetrics.height());