X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/549fad2daeeccac53b88b4777dcc9effbc2110e5..dd07a327:/src/kitemviews/kitemlistview.h diff --git a/src/kitemviews/kitemlistview.h b/src/kitemviews/kitemlistview.h index 7bcaec704..7fb3344b4 100644 --- a/src/kitemviews/kitemlistview.h +++ b/src/kitemviews/kitemlistview.h @@ -59,6 +59,9 @@ class DOLPHIN_EXPORT KItemListView : public QGraphicsWidget Q_PROPERTY(qreal itemOffset READ itemOffset WRITE setItemOffset NOTIFY itemOffsetChanged) public: + /** The position in the view to which an item should be scrolled to. */ + enum ViewItemPosition { Beginning, Middle, End, Nearest }; + explicit KItemListView(QGraphicsWidget *parent = nullptr); ~KItemListView() override; @@ -251,9 +254,10 @@ public: /** * Scrolls to the item with the index \a index so that the item - * will be fully visible. + * will be fully visible. The item is positioned within the view + * as specified by \a viewItemPosition. */ - void scrollToItem(int index); + void scrollToItem(int index, ViewItemPosition viewItemPosition = ViewItemPosition::Nearest); /** * If several properties of KItemListView are changed synchronously, it is @@ -298,6 +302,12 @@ public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; + /** + * Set the bottom offset for moving the view so that the small overlayed statusbar + * won't cover any items by accident. + */ + void setStatusBarOffset(int offset); + Q_SIGNALS: void scrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous); void scrollOffsetChanged(qreal current, qreal previous); @@ -772,6 +782,8 @@ private: QPropertyAnimation *m_indicatorAnimation; + int m_statusBarOffset; + // 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 @@ -789,7 +801,9 @@ private: friend class KItemListController; friend class KItemListControllerTest; friend class KItemListViewAccessible; - friend class KItemListAccessibleCell; + friend class KItemListDelegateAccessible; + + friend class DolphinMainWindowTest; }; /**