┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistview.h
diff options
context:
space:
mode:
authorLeo Treloar <[email protected]>2021-12-25 22:38:46 +1100
committerLeo Treloar <[email protected]>2021-12-28 11:48:23 +1100
commit4b224516f4c646b81a1d7842bcedf1c8fbbfc15f (patch)
tree0ae6fefe6fb47c0924f6ea9e731da9b12b16fa30 /src/kitemviews/kitemlistview.h
parente46e982dbd06d1fc44631e6b86a8b6107135306c (diff)
Add name-only tooltip and make logicalHeightHints a pair of qreal and bool
Diffstat (limited to 'src/kitemviews/kitemlistview.h')
-rw-r--r--src/kitemviews/kitemlistview.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h
index e28487b27..404cf320f 100644
--- a/src/kitemviews/kitemlistview.h
+++ b/src/kitemviews/kitemlistview.h
@@ -189,7 +189,7 @@ public:
* @note the logical height (width) is actually the
* width (height) if the scroll orientation is Qt::Vertical!
*/
- void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint) const;
+ void calculateItemSizeHints(QVector<std::pair<qreal, bool>>& logicalHeightHints, qreal& logicalWidthHint) const;
/**
* If set to true, items having child-items can be expanded to show the child-items as
@@ -222,6 +222,12 @@ public:
QRectF itemContextRect(int index) const;
/**
+ * @return Whether or not the name of the file has been elided. At present this will
+ * only ever be true when in icons view.
+ */
+ bool isElided(int index) const;
+
+ /**
* Scrolls to the item with the index \a index so that the item
* will be fully visible.
*/
@@ -384,6 +390,8 @@ protected:
virtual void updateFont();
virtual void updatePalette();
+ KItemListSizeHintResolver* m_sizeHintResolver;
+
protected Q_SLOTS:
virtual void slotItemsInserted(const KItemRangeList& itemRanges);
virtual void slotItemsRemoved(const KItemRangeList& itemRanges);
@@ -723,7 +731,6 @@ private:
QHash<int, Cell> m_visibleCells;
int m_scrollBarExtent;
- KItemListSizeHintResolver* m_sizeHintResolver;
KItemListViewLayouter* m_layouter;
KItemListViewAnimation* m_animation;
@@ -803,7 +810,7 @@ public:
virtual void recycle(KItemListWidget* widget);
- virtual void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const = 0;
+ virtual void calculateItemSizeHints(QVector<std::pair<qreal, bool>>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const = 0;
virtual qreal preferredRoleColumnWidth(const QByteArray& role,
int index,
@@ -822,7 +829,7 @@ public:
KItemListWidget* create(KItemListView* view) override;
- void calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const override;
+ void calculateItemSizeHints(QVector<std::pair<qreal, bool>>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const override;
qreal preferredRoleColumnWidth(const QByteArray& role,
int index,
@@ -856,7 +863,7 @@ KItemListWidget* KItemListWidgetCreator<T>::create(KItemListView* view)
}
template<class T>
-void KItemListWidgetCreator<T>::calculateItemSizeHints(QVector<qreal>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const
+void KItemListWidgetCreator<T>::calculateItemSizeHints(QVector<std::pair<qreal, bool>>& logicalHeightHints, qreal& logicalWidthHint, const KItemListView* view) const
{
return m_informant->calculateItemSizeHints(logicalHeightHints, logicalWidthHint, view);
}