[NUI] Public Style apis (#1434)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / PreloadStyle / DefaultDropDownStyle.cs
1 /*
2  * Copyright(c) 2020 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 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
19
20 namespace Tizen.NUI.Components
21 {
22     /// <summary>
23     /// The default DropDown style
24     /// </summary>
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     public class DefaultDropDownStyle : StyleBase
27     {
28         /// <summary>
29         /// Return default DropDown style
30         /// </summary>
31         internal protected override ViewStyle GetViewStyle()
32         {
33             DropDownStyle style = new DropDownStyle
34             {
35                 Position = new Position(50, 50),
36                 // WidthResizePolicy = ResizePolicyType.FitToChildren,
37                 // HeightResizePolicy = ResizePolicyType.FitToChildren,
38                 // HeaderText = new TextLabelStyle
39                 // {
40                 //     Text = new Selector<string> { All = "TitleArea" },
41                 //     PointSize = new Selector<float?> { All = 28 },
42                 //     TextColor = new Selector<Color> { All = new Color(0, 0, 0, 1) },
43                 //     FontFamily = "SamsungOneUI 500C",
44                 // },
45                 // BackgroundColor = new Selector<Color> { All = new Color(1, 1, 1, 1) },
46
47                 Button = new ButtonStyle
48                 {
49                     ParentOrigin = ParentOrigin.TopLeft,
50                     PivotPoint = PivotPoint.TopLeft,
51                     BackgroundImage = new Selector<string>
52                     {
53                         Normal = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_n.png"),
54                         Pressed = DefaultStyle.GetResourcePath("nui_component_default_checkbox_bg_p.png")
55                     },
56                     BackgroundImageBorder = (Rectangle)6,
57                     Text = new TextLabelStyle
58                     {
59                         Text = "Select an item",
60                         PointSize = DefaultStyle.PointSizeNormal,
61                         TextColor = Color.Black,
62                     },
63                     Icon = new ImageViewStyle
64                     {
65                         Size = new Size(28, 28),
66                         ResourceUrl = DefaultStyle.GetResourcePath("nui_component_default_dropdown_button_icon.png"),
67                     },
68                     IconRelativeOrientation = Button.IconOrientation.Right,
69                     IconPadding = 6,
70                 },
71                 ListBackgroundImage = new ImageViewStyle
72                 {
73                     ResourceUrl = DefaultStyle.GetResourcePath("nui_component_default_dropdown_list_bg.png"),
74                     Border = (Rectangle)6,
75                     Size = new Size(280, 360),
76                 },
77                 SpaceBetweenButtonTextAndIcon = 10,
78                 ListPadding = 5,
79             };
80             return style;
81         }
82     }
83
84     /// <summary>
85     /// The default DropDownItem style
86     /// </summary>
87     [EditorBrowsable(EditorBrowsableState.Never)]
88     public class DefaultDropDownItemStyle : StyleBase
89     {
90         /// <summary>
91         /// Return default DropDownItem style
92         /// </summary>
93         internal protected override ViewStyle GetViewStyle()
94         {
95             DropDownItemStyle style = new DropDownItemStyle
96             {
97                 Size = new Size(360, 50),
98                 BackgroundColor = new Selector<Color>
99                 {
100                     Pressed = new Color(0.05f, 0.63f, 0.9f, 1),
101                     Selected = new Color(0.8f, 0.8f, 0.8f, 1),
102                     Normal = new Color(1, 1, 1, 1),
103                 },
104                 Text = new TextLabelStyle
105                 {
106                     PointSize = DefaultStyle.PointSizeNormal,
107                     Position = new Position(28, 0),
108                     Text = "List item",
109                 },
110             };
111             return style;
112         }
113     }
114 }