From d9f9e69ce1bdd6f898ee21cb2f14607bd90fa07b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 30 Sep 2011 23:22:56 +0200 Subject: Implement smooth-scrolling for horizontal and vertical scrollbars Currently only a smoothscrolling was provided into the scroll-direction, but not in case of the details-view where a horizontal scrollbar might be shown too. Some minor adjustments of the private KItemListSmoothScroller interface will be done later... --- src/kitemviews/kitemlistcontainer.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/kitemviews/kitemlistcontainer.h') diff --git a/src/kitemviews/kitemlistcontainer.h b/src/kitemviews/kitemlistcontainer.h index 36ac9753e..4d6eadbbb 100644 --- a/src/kitemviews/kitemlistcontainer.h +++ b/src/kitemviews/kitemlistcontainer.h @@ -29,6 +29,7 @@ #include class KItemListController; +class KItemListSmoothScroller; class KItemListView; class KItemModelBase; class QPropertyAnimation; @@ -54,13 +55,12 @@ protected: virtual void showEvent(QShowEvent* event); virtual void resizeEvent(QResizeEvent* event); virtual void scrollContentsBy(int dx, int dy); - virtual bool eventFilter(QObject* obj, QEvent* event); virtual void wheelEvent(QWheelEvent* event); private slots: + void slotScrollOrientationChanged(Qt::Orientation current, Qt::Orientation previous); void slotModelChanged(KItemModelBase* current, KItemModelBase* previous); void slotViewChanged(KItemListView* current, KItemListView* previous); - void slotAnimationStateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); void scrollTo(qreal offset); void updateScrollOffsetScrollBar(); void updateItemOffsetScrollBar(); @@ -68,13 +68,13 @@ private slots: private: void initialize(); void updateGeometries(); + void updateSmoothScrollers(Qt::Orientation orientation); private: KItemListController* m_controller; - bool m_scrollBarPressed; - bool m_smoothScrolling; - QPropertyAnimation* m_smoothScrollingAnimation; + KItemListSmoothScroller* m_horizontalSmoothScroller; + KItemListSmoothScroller* m_verticalSmoothScroller; }; #endif -- cgit v1.3