]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewautoscroller.h
I'm very sorry for breaking the build: I forgot to add the new files :-(
[dolphin.git] / src / dolphinviewautoscroller.h
index 6ef6631f7cef637b94aa12c86ea1b09dfc1da15e..a858d27cbf8f5c60407e3cad4a1acf075b4b96f9 100644 (file)
@@ -23,6 +23,7 @@
 #include <QObject>
 
 class QAbstractItemView;
+class QModelIndex;
 class QTimer;
 
 /**
@@ -38,6 +39,14 @@ class DolphinViewAutoScroller : public QObject
 public:
     DolphinViewAutoScroller(QAbstractItemView* parent);
     virtual ~DolphinViewAutoScroller();
+    bool isActive() const;
+
+    /**
+     * Must be invoked by the parent item view, when QAbstractItemView::currentChanged()
+     * has been called. Assures that the current item stays visible when it has been
+     * changed by the keyboard.
+     */
+    void handleCurrentIndexChange(const QModelIndex& current, const QModelIndex& previous);
 
 protected:
     virtual bool eventFilter(QObject* watched, QEvent* event);
@@ -57,6 +66,7 @@ private:
 
 private:
     bool m_rubberBandSelection;
+    bool m_keyPressed;
     int m_horizontalScrollInc;
     int m_verticalScrollInc;
     QAbstractItemView* m_itemView;