[NUI] Apply default style to Tab and Button component (#1401) (#1402)
authorJiyun Yang <ji.yang@samsung.com>
Thu, 13 Feb 2020 07:37:09 +0000 (16:37 +0900)
committerGitHub <noreply@github.com>
Thu, 13 Feb 2020 07:37:09 +0000 (16:37 +0900)
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
src/Tizen.NUI.Components/PreloadStyle/DefaultButtonStyle.cs
src/Tizen.NUI.Components/PreloadStyle/DefaultStyle.cs
src/Tizen.NUI.Components/PreloadStyle/DefaultTabStyle.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Utils/StyleManager.cs

index 5e1dc24..1064281 100644 (file)
@@ -32,6 +32,7 @@ namespace Tizen.NUI.Components
         {
             ButtonStyle style = new ButtonStyle
             {
+                Size = new Size(100, 45),
                 BackgroundColor = new Selector<Color>
                 {
                     Normal = new Color(0.88f, 0.88f, 0.88f, 1),
index 57bdd43..0445042 100644 (file)
@@ -23,6 +23,8 @@ namespace Tizen.NUI.Components
     {
         internal const float PointSizeNormal = 12;
 
+        internal const float PointSizeTitle = 16;
+
         static internal string GetResourcePath(string filename)
         {
             return "/usr/share/dotnet.tizen/framework/res/" + filename;
diff --git a/src/Tizen.NUI.Components/PreloadStyle/DefaultTabStyle.cs b/src/Tizen.NUI.Components/PreloadStyle/DefaultTabStyle.cs
new file mode 100644 (file)
index 0000000..5a4f895
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System.ComponentModel;
+using Tizen.NUI.BaseComponents;
+
+namespace Tizen.NUI.Components
+{
+    /// <summary>
+    /// The default Tab style
+    /// </summary>
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public class DefaultTabStyle : StyleBase
+    {
+        /// <summary>
+        /// Return default Tab style
+        /// </summary>
+        internal protected override ViewStyle GetAttributes()
+        {
+            TabStyle style = new TabStyle
+            {
+                BackgroundColor = Color.Yellow,
+                Size = new Size(480, 80),
+                UnderLine = new ViewStyle
+                {
+                    Size = new Size(0, 6),
+                    PositionUsesPivotPoint = true,
+                    ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
+                    PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
+                    BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
+                },
+                Text = new TextLabelStyle
+                {
+                    PointSize = DefaultStyle.PointSizeTitle,
+                    TextColor = new Selector<Color>
+                    {
+                        Normal = Color.Black,
+                        Selected = new Color(0.05f, 0.63f, 0.9f, 1),
+                    },
+                },
+            };
+            return style;
+        }
+    }
+}
index f3a4ff0..908e1a5 100755 (executable)
@@ -261,6 +261,7 @@ namespace Tizen.NUI.Components
             defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Popup), new DefaultPopupStyle());
             defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.DropDown), new DefaultDropDownStyle());
             defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.DropDown.DropDownDataItem), new DefaultDropDownItemStyle());
+            defaultComponentsStyle.Add(typeof(Tizen.NUI.Components.Tab), new DefaultTabStyle());
         }
     }
 }