To enable and disable scrolling of scrollbar, ScrollEnabled is added.
Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
private Calculator calculator;
private Size containerSize = new Size(0, 0);
private ScrollbarStyle scrollbarStyle => ViewStyle as ScrollbarStyle;
+ private bool mScrollEnabled = true;
#endregion Fields
[EditorBrowsable(EditorBrowsableState.Never)]
public override void ScrollTo(float position, uint durationMs = 0, AlphaFunction alphaFunction = null)
{
+ if (mScrollEnabled == false)
+ {
+ return;
+ }
+
if (calculator == null)
{
return;
thumbVisual.UpdateVisual(true);
}
+ /// <inheritdoc/>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool ScrollEnabled
+ {
+ get
+ {
+ return mScrollEnabled;
+ }
+ set
+ {
+ if (value != mScrollEnabled)
+ {
+ mScrollEnabled = value;
+ }
+ }
+ }
+
#endregion Methods
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class ScrollbarBase : Control
{
+ private bool mScrollEnabled = true;
+
#region Constructors
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract void Initialize(float contentLength, float viewportLength, float currentPosition, bool isHorizontal = false);
+ /// <summary>
+ /// Enable or disable scrolling.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public abstract bool ScrollEnabled { get; set; }
+
#endregion Methods
}
}
private Size containerSize = new Size(0, 0);
private Animation thumbStartAngleAnimation;
private Animation thumbSweepAngleAnimation;
+ private bool mScrollEnabled = true;
#endregion Fields
{
currentPosition = position;
+ if (mScrollEnabled == false)
+ {
+ return;
+ }
+
if (thumbVisual == null)
{
return;
thumbVisual.UpdateVisual(true);
}
+ /// <inheritdoc/>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool ScrollEnabled
+ {
+ get
+ {
+ return mScrollEnabled;
+ }
+ set
+ {
+ if (value != mScrollEnabled)
+ {
+ mScrollEnabled = value;
+ }
+ }
+ }
+
#endregion Methods
}
}