[NUI] Public Style apis (#1434)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / PreloadStyle / DefaultPopupStyle.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 Popup style
24     /// </summary>
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     public class DefaultPopupStyle : StyleBase
27     {
28         /// <summary>
29         /// Return default Popup style
30         /// </summary>
31         internal protected override ViewStyle GetViewStyle()
32         {
33             PopupStyle style = new PopupStyle
34             {
35                 Size = new Size(500, 280),
36                 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
37                 ImageShadow = new ImageShadow
38                 {
39                     Url = DefaultStyle.GetResourcePath("nui_component_default_popup_shadow.png"),
40                     Border = new Rectangle(24, 24, 24, 24),
41                     Offset = new Vector2(-24, -24),
42                     Extents = new Vector2(48, 48),
43                 },
44                 Title = new TextLabelStyle
45                 {
46                     PointSize = 16,
47                     TextColor = Color.Black,
48                     PositionUsesPivotPoint = true,
49                     ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
50                     PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
51                     HorizontalAlignment = HorizontalAlignment.Begin,
52                     VerticalAlignment = VerticalAlignment.Bottom,
53                     Padding = 20,
54                     Text = "Title",
55                 },
56                 Buttons = new ButtonStyle
57                 {
58                     Size = new Size(0, 80),
59                     PositionUsesPivotPoint = true,
60                     ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
61                     PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
62                     BackgroundColor = new Selector<Color>
63                     {
64                         Normal = new Color(1, 1, 1, 1),
65                         Pressed = new Color(1, 1, 1, 0.5f),
66                     },
67                     Overlay = new ImageViewStyle
68                     {
69                         PositionUsesPivotPoint = true,
70                         ParentOrigin = Tizen.NUI.ParentOrigin.Center,
71                         PivotPoint = Tizen.NUI.PivotPoint.Center,
72                         WidthResizePolicy = ResizePolicyType.FillToParent,
73                         HeightResizePolicy = ResizePolicyType.FillToParent,
74                         BackgroundColor = new Selector<Color>
75                         {
76                             Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),
77                             Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),
78                             Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),
79                         }
80                     },
81                     Text = new TextLabelStyle
82                     {
83                         PositionUsesPivotPoint = true,
84                         ParentOrigin = Tizen.NUI.ParentOrigin.Center,
85                         PivotPoint = Tizen.NUI.PivotPoint.Center,
86                         HorizontalAlignment = HorizontalAlignment.Center,
87                         VerticalAlignment = VerticalAlignment.Center,
88                         TextColor = new Color(0.05f, 0.63f, 0.9f, 1)
89                     },
90                 },
91             };
92             return style;
93         }
94     }
95 }