[NUI] Update theme system
[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 = "BreezeSans",
42                 PixelSize = 32,
43                 TextColor = new Color(0.00f, 0.05f, 0.17f, 1),
44                 FontStyle = new PropertyMap().Add("weight", new PropertyValue("light")),
45             });
46
47             // TextField style.
48             theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextField", new TextFieldStyle()
49             {
50                 FontFamily = "BreezeSans",
51                 PixelSize = 32,
52                 TextColor = new Color(0.00f, 0.05f, 0.17f, 1),
53                 FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")),
54                 PrimaryCursorColor = new Vector4(0.08f, 0.45f, 0.90f, 1),
55                 SecondaryCursorColor = new Vector4(0.08f, 0.45f, 0.90f, 1),
56                 CursorWidth = 3,
57                 SelectionHighlightColor = new Vector4(0.17f, 0.37f, 0.72f, 0.20f),
58                 GrabHandleColor = new Color(0.08f, 0.45f, 0.90f, 1),
59                 GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png",
60                 SelectionHandleImageLeft = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png")),
61                 SelectionHandleImageRight = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png")),
62             });
63
64             // TextEditor style.
65             theme.AddStyleWithoutClone("Tizen.NUI.BaseComponents.TextEditor", new TextEditorStyle()
66             {
67                 FontFamily = "BreezeSans",
68                 PixelSize = 32,
69                 TextColor = new Color(0.00f, 0.05f, 0.17f, 1),
70                 FontStyle = new PropertyMap().Add("weight", new PropertyValue("regular")),
71                 PrimaryCursorColor = new Vector4(0.08f, 0.45f, 0.90f, 1),
72                 SecondaryCursorColor = new Vector4(0.08f, 0.45f, 0.90f, 1),
73                 CursorWidth = 3,
74                 SelectionHighlightColor = new Vector4(0.17f, 0.37f, 0.72f, 0.20f),
75                 GrabHandleColor = new Color(0.08f, 0.45f, 0.90f, 1),
76                 GrabHandleImage = FrameworkInformation.ResourcePath + "IoT_handler_center_downW.png",
77                 SelectionHandleImageLeft = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downleftW.png")),
78                 SelectionHandleImageRight = new PropertyMap().Add("filename", new PropertyValue(FrameworkInformation.ResourcePath + "IoT_handler_downrightW.png")),
79             });
80
81             return theme;
82         }
83     }
84 }
85
86 #endif // !PROFILE_TV