[NUI][Non-ACR] Replace Style with Control's properties 15/236015/1
authorzhouleonlei <zhouleon.lei@samsung.com>
Fri, 12 Jun 2020 03:21:41 +0000 (11:21 +0800)
committerzhouleonlei <zhouleon.lei@samsung.com>
Fri, 12 Jun 2020 03:27:09 +0000 (11:27 +0800)
Plan to set Style's setter to internal, So replace the Style with
Control's properties

Change-Id: I92ea73a0b081a7184ef7530b9b36595bca23b936

tct-suite-vs/Tizen.NUI.Components.Manual.Tests/ManualTestPage.cs
tct-suite-vs/Tizen.NUI.Components.Manual.Tests/WearableManualTestPage.cs
tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSPopup.cs
tct-suite-vs/Tizen.NUI.Components.Manual.Tests/testcase/TSSwitch.cs
tct-suite-vs/Tizen.NUI.Manual.Tests/ManualTestPage.cs
tct-suite-vs/Tizen.NUI.Manual.Tests/WearableManualTestPage.cs

index 4e97a83..897248c 100755 (executable)
@@ -66,26 +66,22 @@ namespace Tizen.NUI.Components.Tests
                     btn.Name = position.ToString();\r
                     btn.PointSize = ManualTest.GetPointSize();\r
                     btn.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.046f);
-                    btn.Style.Text.TextColor = new Color(0, 0, 0, 1);\r
-                    btn.Style.ImageShadow = new ImageShadow\r
-                    {
-                        Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",
-                        Border = new Rectangle(5, 5, 5, 5)
-                    };
-                    btn.Style.BackgroundImage = new Selector<string>\r
+                    btn.TextColor = new Color(0, 0, 0, 1);\r
+                    btn.ImageShadow = new ImageShadow\r
                     {\r
-                        Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png",\r
-                        Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"\r
+                        Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",\r
+                        Border = new Rectangle(5, 5, 5, 5)\r
                     };\r
+                    btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";\r
+                    btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
                     btn.FocusGained += (obj, e) =>\r
                     {
-                        btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+                        btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
                     };\r
                     btn.FocusLost += (obj, e) =>
                     {
-                        btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";\r
-                    };
-                    btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
+                        btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";\r
+                    };\r
                     btn.ParentOrigin = Position.ParentOriginTopLeft;
                     btn.PivotPoint = PivotPoint.TopLeft;
                     btn.TextAlignment = HorizontalAlignment.Begin;
@@ -246,27 +242,23 @@ namespace Tizen.NUI.Components.Tests
             btn.PointSize = _pointSize;\r
             float buttonWidth = ManualTest.IsMobile() ? Window.Instance.Size.Width * 0.18f : Window.Instance.Size.Width * 0.06f;\r
             btn.Size = new Size(buttonWidth, Window.Instance.Size.Height * 0.046f);\r
-            btn.Style.Text.TextColor = new Color(0, 0, 0, 1);\r
-            btn.Style.ImageShadow = new ImageShadow
+            btn.TextColor = new Color(0, 0, 0, 1);\r
+            btn.ImageShadow = new ImageShadow
             {\r
                 Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",\r
                 Border = new Rectangle(5, 5, 5, 5)\r
             };\r
-            btn.Style.BackgroundImage = new Selector<string>
-            {
-                Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png",
-                Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"\r
-            };
-            btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
+            btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+            btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
             btn.ParentOrigin = Position.ParentOriginTopLeft;\r
             btn.PivotPoint = PivotPoint.TopLeft;
             btn.FocusGained += (obj, e) =>
             {
-                btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+                btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
             };
             btn.FocusLost += (obj, e) =>
             {
-                btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+                btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
             };
         }
 
index 7918dc2..0bdbb56 100755 (executable)
@@ -65,9 +65,9 @@ namespace Tizen.NUI.Components.Tests
                     btn.Text = text;\r
                     btn.PointSize = 4.0f;\r
                     btn.TextAlignment = HorizontalAlignment.Begin;\r
-                    btn.Style.Text.TextColor = Color.White;\r
-                    btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";\r
-                    btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
+                    btn.TextColor = Color.White;\r
+                    btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";\r
+                    btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
                 }
             }
 
@@ -266,15 +266,9 @@ namespace Tizen.NUI.Components.Tests
             if (!btn) return;
             btn.Text = text;
             btn.PointSize = 4.0f;
-            btn.Style.Text.TextColor = new Selector<Color>
-            {
-                Normal = new Color(0, 0, 0, 1),
-                Pressed = new Color(0, 0, 0, 0.7f),
-                Selected = new Color(0.058f, 0.631f, 0.92f, 1),
-                Disabled = new Color(0, 0, 0, 0.4f)
-            };
-            btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";
-            btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+            btn.TextColor = new Color(0, 0, 0, 1);
+            btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";
+            btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
             btn.TextColor = Color.White;
         }
 
index d6a9158..1149d3f 100755 (executable)
@@ -60,19 +60,18 @@ namespace Tizen.NUI.Components.Tests
 
         private void CreatePopup()
         {
-            _popup = new Popup();
+            _popup = new Popup(new PopupStyle());
             Assert.IsNotNull(_popup, "Should be not null");
             Assert.IsInstanceOf<Components.Popup>(_popup, "Should be equal!");\r
             _popup.Size = new Size(Window.Instance.Size.Width * 0.2f, Window.Instance.Size.Height * 0.24f);\r
             _popup.Position = new Position(Window.Instance.Size.Width * 0.39f, Window.Instance.Size.Height * 0.2f);\r
 \r
             // Title\r
-            _popup.Style.Title.PointSize = _pointSize;\r
-            _popup.Style.Title.SizeHeight = Window.Instance.Size.Height * 0.025f;\r
-            _popup.Style.Title.HorizontalAlignment = HorizontalAlignment.Begin;\r
-            _popup.Style.Title.Position = new Position(Window.Instance.Size.Width * 0.033f, Window.Instance.Size.Height * 0.01f);\r
-            _popup.Style.Title.Text = "Popup Title";\r
-            _popup.Style.Title.Padding = new Extents(0, 0, 0, 0);\r
+            _popup.TitlePointSize = _pointSize;\r
+            _popup.TitleHeight = (int)(Window.Instance.Size.Height * 0.025f);\r
+            _popup.TitleTextHorizontalAlignment = HorizontalAlignment.Begin;\r
+            _popup.TitleTextPosition = new Position(Window.Instance.Size.Width * 0.033f, Window.Instance.Size.Height * 0.01f);\r
+            _popup.TitleText = "Popup Title";\r
 \r
             // Background\r
             _popup.BackgroundImage = _resourcePath + "/images/popup_background.png";\r
index 24bf78f..3b4762f 100755 (executable)
@@ -55,24 +55,32 @@ namespace Tizen.NUI.Components.Tests
         }
 
         private void CreateSwitch()
-        {
-            _switch = new Switch(new SwitchStyle());
+        {\r
+            SwitchStyle st = new SwitchStyle\r
+            {\r
+                Track = new ImageViewStyle\r
+                {\r
+                    ResourceUrl = new Selector<string>\r
+                    {\r
+                        Normal = _resourcePath + "/images/controller_switch_bg_off.png",\r
+                        Selected = _resourcePath + "/images/controller_switch_bg_on.png",\r
+                    }\r
+                },\r
+                Thumb = new ImageViewStyle\r
+                {\r
+                    Size = new Size(Window.Instance.Size.Width * 0.0312f, Window.Instance.Size.Height * 0.0555f),\r
+                    ResourceUrl = new Selector<string>\r
+                    {\r
+                        Normal = _resourcePath + "/images/controller_switch_handler.png",\r
+                        Selected = _resourcePath + "/images/controller_switch_handler.png",\r
+                    },\r
+                },\r
+            };
+            _switch = new Switch(st);
             Assert.IsNotNull(_switch, "Should be not null");
             Assert.IsInstanceOf<Components.Switch>(_switch, "Should be equal!");
             _switch.Size = new Size(Window.Instance.Size.Width * 0.05f, Window.Instance.Size.Height * 0.0555f);
-            _switch.Position = new Position(Window.Instance.Size.Width * 0.5f, Window.Instance.Size.Height * 0.5f);
-            _switch.Style.Thumb.Size = new Size(Window.Instance.Size.Width * 0.0312f, Window.Instance.Size.Height * 0.0555f);
-            _switch.Style.Track.ResourceUrl = new Selector<string>
-            {
-                Normal = _resourcePath + "/images/controller_switch_bg_off.png",
-                Selected = _resourcePath + "/images/controller_switch_bg_on.png",
-            };
-            _switch.Style.Thumb.ResourceUrl = new Selector<string>
-            {
-                Normal = _resourcePath + "/images/controller_switch_handler.png",
-                Selected = _resourcePath + "/images/controller_switch_handler.png",
-            };\r
-\r
+            _switch.Position = new Position(Window.Instance.Size.Width * 0.5f, Window.Instance.Size.Height * 0.5f);\r
             if (ManualTest.IsWearable())
             {\r
                 _wearTestPage.ExecuteTC(_switch);\r
index 231bdd4..4e03955 100755 (executable)
@@ -66,26 +66,22 @@ namespace Tizen.NUI.Tests
                     btn.Name = position.ToString();
                     btn.PointSize = ManualTest.GetPointSize();
                     btn.Size = new Size(Window.Instance.Size.Width, Window.Instance.Size.Height * 0.046f);
-                    btn.Style.Text.TextColor = new Color(0, 0, 0, 1);
-                    btn.Style.ImageShadow = new ImageShadow
+                    btn.TextColor = new Color(0, 0, 0, 1);
+                    btn.ImageShadow = new ImageShadow
                     {
                         Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",
                         Border = new Rectangle(5, 5, 5, 5)
                     };
-                    btn.Style.BackgroundImage = new Selector<string>
-                    {
-                        Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png",
-                        Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"
-                    };
+                    btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+                    btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
                     btn.FocusGained += (obj, e) =>
                     {
-                        btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+                        btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
                     };
                     btn.FocusLost += (obj, e) =>
                     {
-                        btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+                        btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
                     };
-                    btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
                     btn.ParentOrigin = Position.ParentOriginTopLeft;
                     btn.PivotPoint = PivotPoint.TopLeft;
                     btn.TextAlignment = HorizontalAlignment.Begin;
@@ -246,27 +242,23 @@ namespace Tizen.NUI.Tests
             btn.PointSize = _pointSize;
             float buttonWidth = ManualTest.IsMobile() ? Window.Instance.Size.Width * 0.18f : Window.Instance.Size.Width * 0.06f;
             btn.Size = new Size(buttonWidth, Window.Instance.Size.Height * 0.046f);
-            btn.Style.Text.TextColor = new Color(0, 0, 0, 1);
-            btn.Style.ImageShadow = new ImageShadow
+            btn.TextColor = new Color(0, 0, 0, 1);
+            btn.ImageShadow = new ImageShadow
             {
                 Url = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_btn_shadow.png",
                 Border = new Rectangle(5, 5, 5, 5)
             };
-            btn.Style.BackgroundImage = new Selector<string>
-            {
-                Focused = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png",
-                Other = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png"
-            };
-            btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+            btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+            btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
             btn.ParentOrigin = Position.ParentOriginTopLeft;
             btn.PivotPoint = PivotPoint.TopLeft;
             btn.FocusGained += (obj, e) =>
             {
-                btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
+                btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_point_btn_normal.png";
             };
             btn.FocusLost += (obj, e) =>
             {
-                btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
+                btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/rectangle_toggle_btn_normal.png";
             };
         }
 
index f945921..f9a3f20 100755 (executable)
@@ -65,9 +65,9 @@ namespace Tizen.NUI.Tests
                     btn.Text = text;\r
                     btn.PointSize = 4.0f;\r
                     btn.TextAlignment = HorizontalAlignment.Begin;\r
-                    btn.Style.Text.TextColor = Color.White;\r
-                    btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";\r
-                    btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
+                    btn.TextColor = Color.White;\r
+                    btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";\r
+                    btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);\r
                 }
             }
 
@@ -266,15 +266,9 @@ namespace Tizen.NUI.Tests
             if (!btn) return;
             btn.Text = text;
             btn.PointSize = 4.0f;
-            btn.Style.Text.TextColor = new Selector<Color>
-            {
-                Normal = new Color(0, 0, 0, 1),
-                Pressed = new Color(0, 0, 0, 0.7f),
-                Selected = new Color(0.058f, 0.631f, 0.92f, 1),
-                Disabled = new Color(0, 0, 0, 0.4f)
-            };
-            btn.Style.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";
-            btn.Style.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
+            btn.TextColor = new Color(0, 0, 0, 1);
+            btn.BackgroundImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "/images/controller_btn_check_on.png";
+            btn.BackgroundImageBorder = new Rectangle(5, 5, 5, 5);
             btn.TextColor = Color.White;
         }