[NUI] Fix TextEditor default theme
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Theme / DefaultThemeCommon.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #if !PROFILE_TV
18
19 using System.Diagnostics.CodeAnalysis;
20 using Tizen.NUI.BaseComponents;
21
22 namespace Tizen.NUI
23 {
24     internal partial class DefaultThemeCreator
25     {
26         /// <summary>
27         /// The base theme description.
28         /// </summary>
29         [SuppressMessage("Microsoft.Reliability", "CA2000: Dispose objects before losing scope", Justification = "The responsibility to dispose the object is transferred to the theme object.")]
30         public Theme Create()
31         {
32             Theme theme = new Theme()
33             {
34                 Id = DefaultId,
35                 Version = DefaultVersion,
36             };
37
38             // TextLabel style.
39             theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextLabel", new TextLabelStyle()
40             {
41                 FontFamily = "TizenSans",
42                 PixelSize = 24,
43                 TextColor = new Color(0.04f, 0.05f, 0.13f, 1),
44                 FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")),
45                 AutoScrollLoopCount = 2,
46                 AutoScrollGap = 50.0f,
47                 AutoScrollSpeed = 80,
48                 FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
49             });
50
51             // TextField style.
52             theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextField", new TextFieldStyle()
53             {
54                 FontFamily = "TizenSans",
55                 PixelSize = 24,
56                 TextColor = new Color(0.04f, 0.05f, 0.13f, 1),
57                 PlaceholderTextColor = new Vector4(0.79f, 0.79f, 0.79f, 1),
58                 FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")),
59                 PrimaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
60                 SecondaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
61                 CursorWidth = 2,
62                 FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
63                 SelectionHighlightColor = new Vector4(1.00f, 0.38f, 0.00f, 0.30f),
64                 GrabHandleColor = new Color(1.00f, 1.00f, 1.00f, 1),
65                 GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png",
66                 SelectionHandleImageLeft = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png")),
67                 SelectionHandleImageRight = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png")),
68                 SelectionPopupStyle = new PropertyMap()
69                 .Add(SelectionPopupStyleProperty.MaxSize, new PropertyValue(new Vector2(1200.0f, 40.0f)))
70                 .Add(SelectionPopupStyleProperty.DividerSize, new PropertyValue(new Vector2(0.0f, 0.0f)))
71                 .Add(SelectionPopupStyleProperty.DividerPadding, new PropertyValue(new Vector4(0.0f, 0.0f, 0.0f, 0.0f)))
72                 .Add(SelectionPopupStyleProperty.Background, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-background.9.png"))))
73                 .Add(SelectionPopupStyleProperty.BackgroundBorder, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-border.9.png"))))
74                 .Add(SelectionPopupStyleProperty.PressedColor, new PropertyValue(new Vector4(1.0f, 0.39f, 0.0f, 0.16f)))
75                 .Add(SelectionPopupStyleProperty.PressedCornerRadius, new PropertyValue(12.0f))
76                 .Add(SelectionPopupStyleProperty.FadeInDuration, new PropertyValue(0.25f))
77                 .Add(SelectionPopupStyleProperty.FadeOutDuration, new PropertyValue(0.25f))
78                 .Add(SelectionPopupStyleProperty.EnableScrollBar, new PropertyValue(false))
79                 .Add(SelectionPopupStyleProperty.LabelMinimumSize, new PropertyValue(new Vector2(0, 40.0f)))
80                 .Add(SelectionPopupStyleProperty.LabelPadding, new PropertyValue(new Vector4(-4.0f, -4.0f, 0.0f, 0.0f)))
81                 .Add(SelectionPopupStyleProperty.LabelTextVisual, new PropertyValue(new PropertyMap()
82                     .Add(TextVisualProperty.PointSize, new PropertyValue(6.0f))
83                     .Add(TextVisualProperty.TextColor, new PropertyValue(new Vector4(1.00f, 0.38f, 0.00f, 1)))
84                     .Add(TextVisualProperty.FontFamily, new PropertyValue("TizenSans"))
85                     .Add(TextVisualProperty.FontStyle, new PropertyValue(new PropertyMap().Add("weight", new PropertyValue("regular")))))),
86             });
87
88             // TextEditor style.
89             theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextEditor", new TextEditorStyle()
90             {
91                 FontFamily = "TizenSans",
92                 PixelSize = 24,
93                 TextColor = new Color(0.04f, 0.05f, 0.13f, 1),
94                 PlaceholderTextColor = new Color(0.79f, 0.79f, 0.79f, 1),
95                 FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")),
96                 PrimaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
97                 SecondaryCursorColor = new Vector4(0.04f, 0.05f, 0.13f, 1),
98                 CursorWidth = 2,
99                 EnableScrollBar = true,
100                 ScrollBarShowDuration = 0.8f,
101                 ScrollBarFadeDuration = 0.5f,
102                 FontSizeScale = Tizen.NUI.FontSizeScale.UseSystemSetting,
103                 SelectionHighlightColor = new Vector4(1.00f, 0.38f, 0.00f, 0.30f),
104                 GrabHandleColor = new Color(1.00f, 1.00f, 1.00f, 1),
105                 GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png",
106                 SelectionHandleImageLeft = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png")),
107                 SelectionHandleImageRight = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png")),
108                 SelectionPopupStyle = new PropertyMap()
109                 .Add(SelectionPopupStyleProperty.MaxSize, new PropertyValue(new Vector2(1200.0f, 40.0f)))
110                 .Add(SelectionPopupStyleProperty.DividerSize, new PropertyValue(new Vector2(0.0f, 0.0f)))
111                 .Add(SelectionPopupStyleProperty.DividerPadding, new PropertyValue(new Vector4(0.0f, 0.0f, 0.0f, 0.0f)))
112                 .Add(SelectionPopupStyleProperty.Background, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-background.9.png"))))
113                 .Add(SelectionPopupStyleProperty.BackgroundBorder, new PropertyValue(new PropertyMap().Add(ImageVisualProperty.URL, new PropertyValue(FrameworkInformation.ResourcePath + "IoT-selection-popup-border.9.png"))))
114                 .Add(SelectionPopupStyleProperty.PressedColor, new PropertyValue(new Vector4(1.0f, 0.39f, 0.0f, 0.16f)))
115                 .Add(SelectionPopupStyleProperty.PressedCornerRadius, new PropertyValue(12.0f))
116                 .Add(SelectionPopupStyleProperty.FadeInDuration, new PropertyValue(0.25f))
117                 .Add(SelectionPopupStyleProperty.FadeOutDuration, new PropertyValue(0.25f))
118                 .Add(SelectionPopupStyleProperty.EnableScrollBar, new PropertyValue(false))
119                 .Add(SelectionPopupStyleProperty.LabelMinimumSize, new PropertyValue(new Vector2(0, 40.0f)))
120                 .Add(SelectionPopupStyleProperty.LabelPadding, new PropertyValue(new Vector4(-4.0f, -4.0f, 0.0f, 0.0f)))
121                 .Add(SelectionPopupStyleProperty.LabelTextVisual, new PropertyValue(new PropertyMap()
122                     .Add(TextVisualProperty.PointSize, new PropertyValue(6.0f))
123                     .Add(TextVisualProperty.TextColor, new PropertyValue(new Vector4(1.00f, 0.38f, 0.00f, 1)))
124                     .Add(TextVisualProperty.FontFamily, new PropertyValue("TizenSans"))
125                     .Add(TextVisualProperty.FontStyle, new PropertyValue(new PropertyMap().Add("weight", new PropertyValue("regular")))))),
126             });
127
128             return theme;
129         }
130     }
131 }
132
133 #endif // !PROFILE_TV