X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/f65b0899c3666561cafac14f67ab0bb8a5bfa00a..40cc5f665d:/src/kitemviews/kstandarditemlistwidget.h diff --git a/src/kitemviews/kstandarditemlistwidget.h b/src/kitemviews/kstandarditemlistwidget.h index 1c3c61c38..35d4886b6 100644 --- a/src/kitemviews/kstandarditemlistwidget.h +++ b/src/kitemviews/kstandarditemlistwidget.h @@ -23,12 +23,13 @@ class DOLPHIN_EXPORT KStandardItemListWidgetInformant : public KItemListWidgetIn public: KStandardItemListWidgetInformant(); ~KStandardItemListWidgetInformant() override; - - void calculateItemSizeHints(QVector& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const override; + + void calculateItemSizeHints(QVector>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const override; qreal preferredRoleColumnWidth(const QByteArray& role, int index, const KItemListView* view) const override; + protected: /** * @return The value of the "text" role. The default implementation returns @@ -59,15 +60,15 @@ protected: */ virtual QFont customizedFontForLinks(const QFont& baseFont) const; - void calculateIconsLayoutItemSizeHints(QVector& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; - void calculateCompactLayoutItemSizeHints(QVector& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; - void calculateDetailsLayoutItemSizeHints(QVector& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; + void calculateIconsLayoutItemSizeHints(QVector>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; + void calculateCompactLayoutItemSizeHints(QVector>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; + void calculateDetailsLayoutItemSizeHints(QVector>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const; friend class KStandardItemListWidget; // Accesses roleText() }; /** - * @brief Itemlist widget implementation for KStandardItemListView and KStandardItemModel. + * @brief ItemList widget implementation for KStandardItemListView and KStandardItemModel. */ class DOLPHIN_EXPORT KStandardItemListWidget : public KItemListWidget { @@ -87,6 +88,9 @@ public: void setLayout(Layout layout); Layout layout() const; + void setHighlightEntireRow(bool highlightEntireRow); + bool highlightEntireRow() const; + void setSupportsItemExpanding(bool supportsItemExpanding); bool supportsItemExpanding() const; @@ -109,6 +113,12 @@ protected: */ void invalidateCache(); + /** + * Invalidates the icon cache which results in calling KStandardItemListWidget::refreshCache() as + * soon as the item needs to get repainted. + */ + void invalidateIconCache(); + /** * Is called if the cache got invalidated by KStandardItemListWidget::invalidateCache(). * The default implementation is empty. @@ -161,11 +171,13 @@ protected: void dataChanged(const QHash& current, const QSet& roles = QSet()) override; void visibleRolesChanged(const QList& current, const QList& previous) override; void columnWidthChanged(const QByteArray& role, qreal current, qreal previous) override; + void sidePaddingChanged(qreal width) override; void styleOptionChanged(const KItemListStyleOption& current, const KItemListStyleOption& previous) override; void hoveredChanged(bool hovered) override; void selectedChanged(bool selected) override; void siblingsInformationChanged(const QBitArray& current, const QBitArray& previous) override; void editedRoleChanged(const QByteArray& current, const QByteArray& previous) override; + void iconSizeChanged(int current, int previous) override; void resizeEvent(QGraphicsSceneResizeEvent* event) override; void showEvent(QShowEvent* event) override; void hideEvent(QHideEvent* event) override; @@ -234,6 +246,7 @@ private: QFont m_customizedFont; QFontMetrics m_customizedFontMetrics; bool m_isExpandable; + bool m_highlightEntireRow; bool m_supportsItemExpanding; bool m_dirtyLayout; @@ -245,6 +258,7 @@ private: QPixmap m_pixmap; QSize m_scaledPixmapSize; //Size of the pixmap in device independent pixels + qreal m_columnWidthSum; QRectF m_iconRect; // Cache for KItemListWidget::iconRect() QPixmap m_hoverPixmap; // Cache for modified m_pixmap when hovering the item