From 56852cff392f33ee731129fd9a755544d817e590 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 23 Sep 2011 19:09:01 +0200 Subject: Allow resizing of columns by the user Still open: - Column content is not clipped correctly - First column is not automatically increased to the available width like in Dolphin 1.7 --- src/kitemviews/kitemlistview.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/kitemviews/kitemlistview.h') diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index da02e0bc2..b088ea487 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -147,6 +147,12 @@ public: int lastVisibleIndex() const; virtual QSizeF itemSizeHint(int index) const; + + /** + * @return The size of each visible role in case if KItemListView::itemSize() + * is empty. This allows to have dynamic but equal role sizes between + * all items. Per default an empty hash is returned. + */ virtual QHash visibleRoleSizes() const; /** @@ -228,6 +234,16 @@ private slots: void slotRubberBandPosChanged(); void slotRubberBandActivationChanged(bool active); + /** + * Is invoked if the visible role-width of one role in the header has + * been changed by the user. It is remembered that the user has modified + * the role-width, so that it won't be changed anymore automatically to + * calculate an optimized width. + */ + void slotVisibleRoleWidthChanged(const QByteArray& role, + qreal currentWidth, + qreal previousWidth); + /** * Triggers the autoscrolling if autoScroll() is enabled by checking the * current mouse position. If the mouse position is within the autoscroll @@ -354,6 +370,7 @@ private: QTimer* m_autoScrollTimer; KItemListHeader* m_header; + bool m_useHeaderWidths; friend class KItemListController; }; -- cgit v1.3.1