[NUI] Fix TextEditor default theme
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Theme / DefaultThemeCommon.cs
index 09082b7..be84af7 100644 (file)
@@ -23,6 +23,9 @@ namespace Tizen.NUI
 {
     internal partial class DefaultThemeCreator
     {
+        /// <summary>
+        /// The base theme description.
+        /// </summary>
         [SuppressMessage("Microsoft.Reliability", "CA2000: Dispose objects before losing scope", Justification = "The responsibility to dispose the object is transferred to the theme object.")]
         public Theme Create()
         {
@@ -32,30 +35,99 @@ namespace Tizen.NUI
                 Version = DefaultVersion,
             };
 
-            // // TODO Add a TextLabelStyle style to the theme if need.
-            // // This is an example of text label style.
-            // theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextLabel", new TextLabelStyle()
-            // {
-            //     PixelSize = 10,
-            //     TextColor = Color.Red,
-            // });
+            // TextLabel style.
+            theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextLabel", new TextLabelStyle()
+            {
+                FontFamily = "TizenSans",
+                PixelSize = 24,
+                TextColor = new Color(0.04f, 0.05f, 0.13f, 1),
+                FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")),
+                AutoScrollLoopCount = 2,
+                AutoScrollGap = 50.0f,
+                AutoScrollSpeed = 80,
+                FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
+            });
 
-            // // TODO Add a TextFieldStyle to the theme if need.
-            // // This is an example of text filed style.
-            // theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextField", new TextFieldStyle()
-            // {
-            //     //...
-            // });
+            // TextField style.
+            theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextField", new TextFieldStyle()
+            {
+                FontFamily = "TizenSans",
+                PixelSize = 24,
+                TextColor = new Color(0.04f, 0.05f, 0.13f, 1),
+                PlaceholderTextColor = new Vector4(0.79f, 0.79f, 0.79f, 1),
+                FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")),
+                PrimaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
+                SecondaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
+                CursorWidth = 2,
+                FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
+                SelectionHighlightColor = new Vector4(1.00f, 0.38f, 0.00f, 0.30f),
+                GrabHandleColor = new Color(1.00f, 1.00f, 1.00f, 1),
+                GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png",
+                SelectionHandleImageLeft = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png")),
+                SelectionHandleImageRight = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png")),
+                SelectionPopupStyle = new PropertyMap()
+                .Add(SelectionPopupStyleProperty.MaxSize, new PropertyValue(new Vector2(1200.0f, 40.0f)))
+                .Add(SelectionPopupStyleProperty.DividerSize, new PropertyValue(new Vector2(0.0f, 0.0f)))
+                .Add(SelectionPopupStyleProperty.DividerPadding, new PropertyValue(new Vector4(0.0f, 0.0f, 0.0f, 0.0f)))
+                .Add(SelectionPopupStyleProperty.Background, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-background.9.png"))))
+                .Add(SelectionPopupStyleProperty.BackgroundBorder, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-border.9.png"))))
+                .Add(SelectionPopupStyleProperty.PressedColor, new PropertyValue(new Vector4(1.0f, 0.39f, 0.0f, 0.16f)))
+                .Add(SelectionPopupStyleProperty.PressedCornerRadius, new PropertyValue(12.0f))
+                .Add(SelectionPopupStyleProperty.FadeInDuration, new PropertyValue(0.25f))
+                .Add(SelectionPopupStyleProperty.FadeOutDuration, new PropertyValue(0.25f))
+                .Add(SelectionPopupStyleProperty.EnableScrollBar, new PropertyValue(false))
+                .Add(SelectionPopupStyleProperty.LabelMinimumSize, new PropertyValue(new Vector2(0, 40.0f)))
+                .Add(SelectionPopupStyleProperty.LabelPadding, new PropertyValue(new Vector4(-4.0f, -4.0f, 0.0f, 0.0f)))
+                .Add(SelectionPopupStyleProperty.LabelTextVisual, new PropertyValue(new PropertyMap()
+                    .Add(TextVisualProperty.PointSize, new PropertyValue(6.0f))
+                    .Add(TextVisualProperty.TextColor, new PropertyValue(new Vector4(1.00f, 0.38f, 0.00f, 1)))
+                    .Add(TextVisualProperty.FontFamily, new PropertyValue("TizenSans"))
+                    .Add(TextVisualProperty.FontStyle, new PropertyValue(new PropertyMap().Add("weight", new PropertyValue("regular")))))),
+            });
 
-            // // TODO Add a TextEditorStyle to the theme if need.
-            // // This is an example of text filed style.
-            // theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextEditor", new TextEditorStyle()
-            // {
-            //     //...
-            // });
+            // TextEditor style.
+            theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextEditor", new TextEditorStyle()
+            {
+                FontFamily = "TizenSans",
+                PixelSize = 24,
+                TextColor = new Color(0.04f, 0.05f, 0.13f, 1),
+                PlaceholderTextColor = new Color(0.79f, 0.79f, 0.79f, 1),
+                FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")),
+                PrimaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
+                SecondaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
+                CursorWidth = 2,
+                EnableScrollBar = true,
+                ScrollBarShowDuration = 0.8f,
+                ScrollBarFadeDuration = 0.5f,
+                FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
+                SelectionHighlightColor = new Vector4(1.00f, 0.38f, 0.00f, 0.30f),
+                GrabHandleColor = new Color(1.00f, 1.00f, 1.00f, 1),
+                GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png",
+                SelectionHandleImageLeft = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png")),
+                SelectionHandleImageRight = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png")),
+                SelectionPopupStyle = new PropertyMap()
+                .Add(SelectionPopupStyleProperty.MaxSize, new PropertyValue(new Vector2(1200.0f, 40.0f)))
+                .Add(SelectionPopupStyleProperty.DividerSize, new PropertyValue(new Vector2(0.0f, 0.0f)))
+                .Add(SelectionPopupStyleProperty.DividerPadding, new PropertyValue(new Vector4(0.0f, 0.0f, 0.0f, 0.0f)))
+                .Add(SelectionPopupStyleProperty.Background, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-background.9.png"))))
+                .Add(SelectionPopupStyleProperty.BackgroundBorder, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-border.9.png"))))
+                .Add(SelectionPopupStyleProperty.PressedColor, new PropertyValue(new Vector4(1.0f, 0.39f, 0.0f, 0.16f)))
+                .Add(SelectionPopupStyleProperty.PressedCornerRadius, new PropertyValue(12.0f))
+                .Add(SelectionPopupStyleProperty.FadeInDuration, new PropertyValue(0.25f))
+                .Add(SelectionPopupStyleProperty.FadeOutDuration, new PropertyValue(0.25f))
+                .Add(SelectionPopupStyleProperty.EnableScrollBar, new PropertyValue(false))
+                .Add(SelectionPopupStyleProperty.LabelMinimumSize, new PropertyValue(new Vector2(0, 40.0f)))
+                .Add(SelectionPopupStyleProperty.LabelPadding, new PropertyValue(new Vector4(-4.0f, -4.0f, 0.0f, 0.0f)))
+                .Add(SelectionPopupStyleProperty.LabelTextVisual, new PropertyValue(new PropertyMap()
+                    .Add(TextVisualProperty.PointSize, new PropertyValue(6.0f))
+                    .Add(TextVisualProperty.TextColor, new PropertyValue(new Vector4(1.00f, 0.38f, 0.00f, 1)))
+                    .Add(TextVisualProperty.FontFamily, new PropertyValue("TizenSans"))
+                    .Add(TextVisualProperty.FontStyle, new PropertyValue(new PropertyMap().Add("weight", new PropertyValue("regular")))))),
+            });
 
             return theme;
         }
     }
 }
-#endif
+
+#endif // !PROFILE_TV