//
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
* ScrollBar is a UI component that can be added to the scrollable controls
* indicating the current scroll position of the scrollable content.
*/
-class ScrollBar : public ControlImpl
+class ScrollBar : public ScrollComponentImpl
{
public:
static Toolkit::ScrollBar New();
/**
- * @copydoc Toolkit::ScrollBar::SetScrollConnector()
+ * @copydoc Toolkit::ScrollComponentImpl::OnScrollConnectorSet()
*/
- void SetScrollConnector( Toolkit::ScrollConnector connector );
+ void OnScrollConnectorSet( Toolkit::ScrollConnector connector );
/**
* @copydoc Toolkit::ScrollBar::SetBackgroundImage()
*/
void OnScrollPositionNotified(PropertyNotification& source);
+ /**
+ * Process the pan gesture per predefined timeout until the gesture is finished.
+ * @return True if the timer should be kept running.
+ */
+ bool OnPanGestureProcessTick();
+
private:
- Toolkit::ScrollConnector mScrollConnector; ///< Connects scroll bar with the scrollable container.
Constrainable mScrollPositionObject; ///< From mScrollConnector
ImageActor mBackground; ///< Background image of scroll bar.
ImageActor mIndicator; ///< Image of scroll indicator.
Animation mAnimation; ///< Scroll indicator Show/Hide Animation.
- float mScrollStart; ///< Scroll Start position (start of drag)
+ float mScrollStart; ///< Scroll Start position (start of drag)
Vector3 mGestureDisplacement; ///< Gesture Displacement.
+ bool mIsPanning; ///< Whether the scroll bar is being panned.
+ float mCurrentScrollPosition; ///< The current scroll position updated by the pan gesture
+
+ Timer mTimer; ///< The timer to process the pan gesture after the gesture is started.
+
Property::Index mPropertyIndicatorPosition; ///< Indicatore Position ("indicator-position")
PropertyNotification mPositionNotification; ///< Stores the property notification used for scroll position changes