From e437476faa42f36590fbb51efe4e41d3bba2827d Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Wed, 22 Jul 2020 13:29:48 +0900 Subject: [PATCH 1/1] [NUI] Scrollbar inherits VisualView instead of Control (#1846) * Control always be a hit actor for touching, but the scrollbar does not need to be. Signed-off-by: Jiyun Yang --- src/Tizen.NUI.Components/Controls/ScrollbarBase.cs | 9 +++++---- src/Tizen.NUI.Components/Style/ScrollbarStyle.cs | 3 ++- src/Tizen.NUI/src/public/BaseComponents/VisualView.cs | 19 +++++++++++++++++-- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/Tizen.NUI.Components/Controls/ScrollbarBase.cs b/src/Tizen.NUI.Components/Controls/ScrollbarBase.cs index 45d8de5..dc7003a 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollbarBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollbarBase.cs @@ -15,6 +15,7 @@ * */ using System.ComponentModel; +using Tizen.NUI.BaseComponents; namespace Tizen.NUI.Components { @@ -24,7 +25,7 @@ namespace Tizen.NUI.Components /// This only contains non-graphical functionalities of basic scrollbar. /// [EditorBrowsable(EditorBrowsableState.Never)] - public abstract class ScrollbarBase : Control + public abstract class ScrollbarBase : VisualView { private bool mScrollEnabled = true; @@ -33,15 +34,15 @@ namespace Tizen.NUI.Components /// /// Create an empty ScrollbarBase. /// - public ScrollbarBase() : base() + public ScrollbarBase() : base(CustomViewBehaviour.ViewBehaviourDefault) { } /// - /// Create an empty Scrollbar with a ControlStyle instance to set style properties. + /// Create an empty Scrollbar with a ViewStyle instance to set style properties. /// [EditorBrowsable(EditorBrowsableState.Never)] - public ScrollbarBase(ControlStyle style) : base(style) + public ScrollbarBase(ViewStyle style) : base(CustomViewBehaviour.ViewBehaviourDefault, style) { } diff --git a/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs b/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs index f2f6615..1aea6d3 100644 --- a/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs +++ b/src/Tizen.NUI.Components/Style/ScrollbarStyle.cs @@ -15,6 +15,7 @@ * */ using System.ComponentModel; +using Tizen.NUI.BaseComponents; using Tizen.NUI.Binding; namespace Tizen.NUI.Components @@ -23,7 +24,7 @@ namespace Tizen.NUI.Components /// ScrollbarStyle is a class which saves Scrollbar's style data. /// [EditorBrowsable(EditorBrowsableState.Never)] - public class ScrollbarStyle : ControlStyle + public class ScrollbarStyle : ViewStyle { #region Fields diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs index 1f86ded..e81b6ba 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs @@ -51,17 +51,32 @@ namespace Tizen.NUI.BaseComponents /// Constructor. /// /// 3 - public VisualView() : base(typeof(VisualView).FullName, CustomViewBehaviour.ViewBehaviourDefault | CustomViewBehaviour.RequiresTouchEventsSupport) + public VisualView() : this(CustomViewBehaviour.ViewBehaviourDefault | CustomViewBehaviour.RequiresTouchEventsSupport) { } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public VisualView(ViewStyle viewStyle) : base(typeof(VisualView).FullName, CustomViewBehaviour.ViewBehaviourDefault | CustomViewBehaviour.RequiresTouchEventsSupport, viewStyle) + public VisualView(ViewStyle viewStyle) : this(CustomViewBehaviour.ViewBehaviourDefault | CustomViewBehaviour.RequiresTouchEventsSupport, viewStyle) { } + /// Create a VisualView with specified behaviour. + /// CustomView behaviour + [EditorBrowsable(EditorBrowsableState.Never)] + public VisualView(CustomViewBehaviour behaviour) : base(typeof(VisualView).FullName, behaviour) + { + } + + /// Create a VisualView with specified behaviour and a style. + /// CustomView behaviour + /// The ViewStyle. + [EditorBrowsable(EditorBrowsableState.Never)] + public VisualView(CustomViewBehaviour behaviour, ViewStyle viewStyle) : base(typeof(VisualView).FullName, behaviour, viewStyle) + { + } + // static constructor registers the control type (for user can add kinds of visuals to it) static VisualView() { -- 2.7.4