From e045b43b3c91831405a4d7ea03ce67a7b77a7011 Mon Sep 17 00:00:00 2001
From: zhouleonlei <56956725+zhouleonlei@users.noreply.github.com>
Date: Wed, 11 Dec 2019 08:23:30 +0800
Subject: [PATCH] [NUI] Fixed TCT failed issues (#1176)
---
src/Tizen.NUI.Components/Controls/Button.cs | 42 +++++++++++---------------
src/Tizen.NUI.Components/Controls/Popup.cs | 4 +--
src/Tizen.NUI.Components/Controls/Scrollbar.cs | 2 +-
src/Tizen.NUI.Components/Controls/Slider.cs | 8 ++---
src/Tizen.NUI.Components/Controls/Switch.cs | 16 ++++------
src/Tizen.NUI.Components/Controls/Tab.cs | 8 ++---
src/Tizen.NUI/src/public/Extents.cs | 2 +-
7 files changed, 33 insertions(+), 49 deletions(-)
diff --git a/src/Tizen.NUI.Components/Controls/Button.cs b/src/Tizen.NUI.Components/Controls/Button.cs
index ce29a8a..74a4e98 100755
--- a/src/Tizen.NUI.Components/Controls/Button.cs
+++ b/src/Tizen.NUI.Components/Controls/Button.cs
@@ -342,6 +342,8 @@ namespace Tizen.NUI.Components
}
}
}
+
+ private StringSelector textSelector = new StringSelector();
///
/// Text string selector in Button.
///
@@ -350,16 +352,15 @@ namespace Tizen.NUI.Components
{
get
{
- return (StringSelector)Style?.Text?.Text;
+ return textSelector;
}
set
{
- if (null != value && null != Style.Text)
- {
- Style.Text.Text = value.Clone() as StringSelector;
- }
+ textSelector.Clone(value);
}
}
+
+ private StringSelector translatableTextSelector = new StringSelector();
///
/// Translateable text string selector in Button.
///
@@ -368,17 +369,15 @@ namespace Tizen.NUI.Components
{
get
{
- return (StringSelector)Style?.Text?.TranslatableText;
+ return translatableTextSelector;
}
set
{
- if (null != value && null != Style?.Text)
- {
- Style.Text.TranslatableText = value.Clone() as StringSelector;
- }
+ translatableTextSelector.Clone(value);
}
}
+ private ColorSelector textColorSelector = new ColorSelector();
///
/// Text color selector in Button.
///
@@ -387,17 +386,15 @@ namespace Tizen.NUI.Components
{
get
{
- return (ColorSelector)Style?.Text?.TextColor;
+ return textColorSelector;
}
set
{
- if(null != value && null != Style.Text)
- {
- Style.Text.TextColor = value.Clone() as ColorSelector;
- }
+ textColorSelector.Clone(value);
}
}
+ private FloatSelector pointSizeSelector = new FloatSelector();
///
/// Text font size selector in Button.
///
@@ -406,17 +403,15 @@ namespace Tizen.NUI.Components
{
get
{
- return (FloatSelector)Style?.Text?.PointSize;
+ return pointSizeSelector;
}
set
{
- if (null != value && null != Style?.Text)
- {
- Style.Text.PointSize = value.Clone() as FloatSelector;
- }
+ pointSizeSelector.Clone(value);
}
}
+ private StringSelector iconURLSelector = new StringSelector();
///
/// Icon image's resource url selector in Button.
///
@@ -425,14 +420,11 @@ namespace Tizen.NUI.Components
{
get
{
- return (StringSelector)Style?.Icon?.ResourceUrl;
+ return iconURLSelector;
}
set
{
- if (null != value && null != Style?.Icon)
- {
- Style.Icon.ResourceUrl = value.Clone() as StringSelector;
- }
+ iconURLSelector.Clone(value);
}
}
diff --git a/src/Tizen.NUI.Components/Controls/Popup.cs b/src/Tizen.NUI.Components/Controls/Popup.cs
index c7fa6d5..06a3d04 100755
--- a/src/Tizen.NUI.Components/Controls/Popup.cs
+++ b/src/Tizen.NUI.Components/Controls/Popup.cs
@@ -83,7 +83,7 @@ namespace Tizen.NUI.Components
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style.Buttons?.Size?.Height ?? 0;
+ return (int)(instance.Style?.Buttons?.Size?.Height ?? 0);
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
@@ -123,7 +123,7 @@ namespace Tizen.NUI.Components
defaultValueCreator: (bindable) =>
{
var instance = (Popup)bindable;
- return instance.Style.Buttons?.Text?.FontFamily;
+ return instance.Style?.Buttons?.Text?.FontFamily.All;
});
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
diff --git a/src/Tizen.NUI.Components/Controls/Scrollbar.cs b/src/Tizen.NUI.Components/Controls/Scrollbar.cs
index fe2be17..5fbcf53 100755
--- a/src/Tizen.NUI.Components/Controls/Scrollbar.cs
+++ b/src/Tizen.NUI.Components/Controls/Scrollbar.cs
@@ -110,7 +110,7 @@ namespace Tizen.NUI.Components
instance.Style.Duration = (uint)newValue;
if (instance.scrollAniPlayer != null)
{
- instance.scrollAniPlayer.Duration = (int)newValue;
+ instance.scrollAniPlayer.Duration = (int)instance.Style.Duration;
}
}
},
diff --git a/src/Tizen.NUI.Components/Controls/Slider.cs b/src/Tizen.NUI.Components/Controls/Slider.cs
index b35b44d..159d6ea 100755
--- a/src/Tizen.NUI.Components/Controls/Slider.cs
+++ b/src/Tizen.NUI.Components/Controls/Slider.cs
@@ -418,6 +418,7 @@ namespace Tizen.NUI.Components
}
}
+ private StringSelector thumbImageURLSelector = new StringSelector();
///
/// Gets or sets the resource url selector of the thumb image object.
///
@@ -426,14 +427,11 @@ namespace Tizen.NUI.Components
{
get
{
- return (StringSelector)Style?.Thumb?.ResourceUrl;
+ return thumbImageURLSelector;
}
set
{
- if (null != value && null != Style?.Thumb)
- {
- Style.Thumb.ResourceUrl = value.Clone() as StringSelector;
- }
+ thumbImageURLSelector.Clone(value);
}
}
diff --git a/src/Tizen.NUI.Components/Controls/Switch.cs b/src/Tizen.NUI.Components/Controls/Switch.cs
index e1b1cc6..8f6351d 100755
--- a/src/Tizen.NUI.Components/Controls/Switch.cs
+++ b/src/Tizen.NUI.Components/Controls/Switch.cs
@@ -96,6 +96,7 @@ namespace Tizen.NUI.Components
}
}
+ private StringSelector switchBackgroundImageURLSelector = new StringSelector();
///
/// Background image's resource url selector in Switch.
///
@@ -104,14 +105,11 @@ namespace Tizen.NUI.Components
{
get
{
- return (StringSelector)Style?.Track?.ResourceUrl;
+ return switchBackgroundImageURLSelector;
}
set
{
- if (null != value && null != Style?.Track)
- {
- Style.Track.ResourceUrl = value.Clone() as StringSelector;
- }
+ switchBackgroundImageURLSelector.Clone(value);
}
}
@@ -134,6 +132,7 @@ namespace Tizen.NUI.Components
}
}
+ private StringSelector switchHandlerImageURLSelector = new StringSelector();
///
/// Handler image's resource url selector in Switch.
///
@@ -142,14 +141,11 @@ namespace Tizen.NUI.Components
{
get
{
- return (StringSelector)Style?.Thumb?.ResourceUrl;
+ return switchHandlerImageURLSelector;
}
set
{
- if (null != value && null != Style?.Thumb)
- {
- Style.Thumb.ResourceUrl = value.Clone() as StringSelector;
- }
+ switchHandlerImageURLSelector.Clone(value);
}
}
diff --git a/src/Tizen.NUI.Components/Controls/Tab.cs b/src/Tizen.NUI.Components/Controls/Tab.cs
index b6e206c..e8873d5 100755
--- a/src/Tizen.NUI.Components/Controls/Tab.cs
+++ b/src/Tizen.NUI.Components/Controls/Tab.cs
@@ -289,6 +289,7 @@ namespace Tizen.NUI.Components
}
}
+ private ColorSelector textColorSelector = new ColorSelector();
///
/// Text color selector in Tab.
///
@@ -297,14 +298,11 @@ namespace Tizen.NUI.Components
{
get
{
- return (ColorSelector)Style?.Text?.TextColor;
+ return textColorSelector;
}
set
{
- if (null != value && null != Style?.Text)
- {
- Style.Text.TextColor = value.Clone() as ColorSelector;
- }
+ textColorSelector.Clone(value);
}
}
diff --git a/src/Tizen.NUI/src/public/Extents.cs b/src/Tizen.NUI/src/public/Extents.cs
index d2d6d72..9985833 100755
--- a/src/Tizen.NUI/src/public/Extents.cs
+++ b/src/Tizen.NUI/src/public/Extents.cs
@@ -91,7 +91,7 @@ namespace Tizen.NUI
Interop.Extents.Extents_start_set(swigCPtr, that.Start);
Interop.Extents.Extents_end_set(swigCPtr, that.End);
Interop.Extents.Extents_top_set(swigCPtr, that.Top);
- Interop.Extents.Extents_bottom_set(swigCPtr, that.End);
+ Interop.Extents.Extents_bottom_set(swigCPtr, that.Bottom);
}
///
--
2.7.4