From 894232ebda5b2cf155a4f4e5bf1287eb700faa18 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 21 May 2012 21:43:26 +0200 Subject: Places Panel: Show drop indicator The dropping itself has not been implemented yet. --- src/kitemviews/kitemlistview.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/kitemviews/kitemlistview.h') diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index de2d2a6bb..de40791da 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -151,6 +151,10 @@ public: void setGroupHeaderCreator(KItemListGroupHeaderCreatorBase* groupHeaderCreator); KItemListGroupHeaderCreatorBase* groupHeaderCreator() const; + /** + * @return The basic size of all items. The size of an item may be larger than + * the basic size (see KItemListView::itemSizeHint() and KItemListView::itemRect()). + */ QSizeF itemSize() const; const KItemListStyleOption& styleOption() const; @@ -626,6 +630,15 @@ private: */ bool scrollBarRequired(const QSizeF& size) const; + /** + * Shows a drop-indicator between items dependent on the given + * cursor position. The cursor position is relative the the upper left + * edge of the view. + * @return Index of the item where the dropping is done. + */ + int showDropIndicator(const QPointF& pos); + void hideDropIndicator(); + /** * Applies the height of the group header to the layouter. The height * depends on the used scroll orientation. @@ -716,6 +729,14 @@ private: KItemListHeader* m_header; KItemListHeaderWidget* m_headerWidget; + // When dragging items into the view where the sort-role of the model + // is empty, a visual indicator should be shown during dragging where + // the dropping will happen. This indicator is specified by an index + // of the item. -1 means that no indicator will be shown at all. + // The m_dropIndicator is set by the KItemListController + // by KItemListView::showDropIndicator() and KItemListView::hideDropIndicator(). + QRectF m_dropIndicator; + friend class KItemListContainer; // Accesses scrollBarRequired() friend class KItemListHeader; // Accesses m_headerWidget friend class KItemListController; -- cgit v1.3