ScrollBar::ScrollBar(Toolkit::ScrollBar::Direction direction)
: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+ mIndicatorShowAlpha(1.0f),
mDirection(direction),
mScrollableObject(WeakHandleBase()),
mPropertyScrollPosition(Property::INVALID_INDEX),
mIndicatorShowDuration(DEFAULT_INDICATOR_SHOW_DURATION),
mIndicatorHideDuration(DEFAULT_INDICATOR_HIDE_DURATION),
mScrollStart(0.0f),
- mIsPanning(false),
mCurrentScrollPosition(0.0f),
mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
- mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT)
+ mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT),
+ mIsPanning(false),
+ mIndicatorFirstShow(true)
{
}
if( indicator )
{
mIndicator = indicator;
+ mIndicatorFirstShow = true;
Self().Add(mIndicator);
EnableGestureDetection(Gesture::Type(Gesture::Pan));
mAnimation.Reset();
}
+ if( mIndicatorFirstShow )
+ {
+ // Preserve the alpha value from the stylesheet
+ mIndicatorShowAlpha = Self().GetCurrentColor().a;
+ mIndicatorFirstShow = false;
+ }
+
if(mIndicatorShowDuration > 0.0f)
{
mAnimation = Animation::New( mIndicatorShowDuration );
- mAnimation.AnimateTo( Property( mIndicator, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN );
+ mAnimation.AnimateTo( Property( mIndicator, Actor::Property::COLOR_ALPHA ), mIndicatorShowAlpha, AlphaFunction::EASE_IN );
mAnimation.Play();
}
else
{
- mIndicator.SetOpacity(1.0f);
+ mIndicator.SetOpacity(mIndicatorShowAlpha);
}
}
private:
Actor mIndicator; ///< Image of scroll indicator.
+ float mIndicatorShowAlpha; ///< The alpha value when the indicator is fully shown
Animation mAnimation; ///< Scroll indicator Show/Hide Animation.
Toolkit::ScrollBar::Direction mDirection; ///< The direction of scroll bar (vertical or horizontal)
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
Toolkit::ScrollBar::IndicatorHeightPolicy mIndicatorHeightPolicy; ///< The height policy of scroll indicator (variable or fixed)
Constraint mIndicatorPositionConstraint;
Constraint mIndicatorSizeConstraint;
Constraint mScrollPositionInCurrentAxisConstraint;
+
+ bool mIsPanning : 1; ///< Whether the scroll bar is being panned.
+ bool mIndicatorFirstShow : 1; ///< True if the indicator has never been shown
};
} // namespace Internal