From 4657459937ab7916fc200011fac76fd23e0c4880 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 4 Apr 2012 00:20:02 +0200 Subject: Show the ratings as stars instead of text --- src/kitemviews/kfileitemlistwidget.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/kitemviews/kfileitemlistwidget.h') 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 }; @@ -136,6 +142,19 @@ private: static void applyHiddenEffect(QPixmap& pixmap); 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. */ @@ -176,6 +195,7 @@ private: QColor m_additionalInfoTextColor; QPixmap m_overlay; + QPixmap m_rating; }; #endif -- cgit v1.3.1