┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemlistwidget.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-04-04 00:20:02 +0200
committerPeter Penz <[email protected]>2012-04-04 00:21:05 +0200
commit4657459937ab7916fc200011fac76fd23e0c4880 (patch)
tree8b45463b36fcf35314d5d368bc1638f69f65bb47 /src/kitemviews/kfileitemlistwidget.h
parentb8a12851b8337dd8524b7edf73bcbb832e339e13 (diff)
Show the ratings as stars instead of text
Diffstat (limited to 'src/kitemviews/kfileitemlistwidget.h')
-rw-r--r--src/kitemviews/kfileitemlistwidget.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemlistwidget.h b/src/kitemviews/kfileitemlistwidget.h
index 44451360b..551b47fc3 100644
--- a/src/kitemviews/kfileitemlistwidget.h
+++ b/src/kitemviews/kfileitemlistwidget.h
@@ -110,10 +110,16 @@ private slots:
void slotCutItemsChanged();
private:
+ /**
+ * Typedefinitions for roles that require a special handling
+ * and must be accessible in a fast way. The mapping of a
+ * QByteArray role to the type is done by KFileItemListWidget::roleType().
+ */
enum RoleType {
Name,
Size,
Date,
+ Rating,
Generic // Mandatory last entry
};
@@ -137,6 +143,19 @@ private:
static RoleType roleType(const QByteArray& role);
/**
+ * @return Preferred size of the rating-image based on the given
+ * style-option. The height of the font is taken as
+ * reference.
+ */
+ static QSizeF preferredRatingSize(const KItemListStyleOption& option);
+
+ /**
+ * @return Horizontal padding in pixels that is added to the required width of
+ * a column to display the content.
+ */
+ static qreal columnPadding(const KItemListStyleOption& option);
+
+ /**
* @return Shown string for the role \p role of the item with the values \p values.
*/
static QString roleText(const QByteArray& role, const QHash<QByteArray, QVariant>& values);
@@ -176,6 +195,7 @@ private:
QColor m_additionalInfoTextColor;
QPixmap m_overlay;
+ QPixmap m_rating;
};
#endif