2 * Copyright(c) 2020 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
20 namespace Tizen.NUI.Components
23 /// Interface that includes styles for all components for a default theme
25 [EditorBrowsable(EditorBrowsableState.Never)]
26 internal class DefaultTheme : Theme
28 internal static Theme Instance { get; } = new DefaultTheme();
30 protected DefaultTheme() : base()
34 protected override ButtonStyle GetButtonStyle()
36 return new ButtonStyle
38 Size = new Size(100, 45),
39 BackgroundColor = new Selector<Color>
41 Normal = new Color(0.88f, 0.88f, 0.88f, 1),
42 Pressed = new Color(0.77f, 0.77f, 0.77f, 1),
43 Disabled = new Color(0.88f, 0.88f, 0.88f, 1)
45 Text = new TextLabelStyle
47 PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
48 WidthResizePolicy = ResizePolicyType.FillToParent,
49 HeightResizePolicy = ResizePolicyType.FillToParent,
50 HorizontalAlignment = HorizontalAlignment.Center,
51 VerticalAlignment = VerticalAlignment.Center,
52 TextColor = new Selector<Color>
54 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
55 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
56 Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
63 protected override ButtonStyle GetCheckBoxStyle()
65 return new ButtonStyle
67 Size = new Size(30, 30),
68 Icon = new ImageViewStyle
70 WidthResizePolicy = ResizePolicyType.DimensionDependency,
71 HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
72 SizeModeFactor = new Vector3(1, 1, 1),
73 Opacity = new Selector<float?>
78 DisabledSelected = 0.4f
80 BackgroundImage = new Selector<string>
82 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
83 Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
84 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
85 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
86 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png"),
88 ResourceUrl = new Selector<string>
92 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_s.png"),
94 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_s.png"),
97 Text = new TextLabelStyle
99 PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
100 WidthResizePolicy = ResizePolicyType.FillToParent,
101 HeightResizePolicy = ResizePolicyType.FillToParent,
102 HorizontalAlignment = HorizontalAlignment.Center,
103 VerticalAlignment = VerticalAlignment.Center,
104 TextColor = new Selector<Color>
106 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
107 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
108 Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
114 protected override DropDownStyle GetDropDownStyle()
116 return new DropDownStyle
118 Position = new Position(50, 50),
119 Button = new ButtonStyle
121 ParentOrigin = ParentOrigin.TopLeft,
122 PivotPoint = PivotPoint.TopLeft,
123 BackgroundImage = new Selector<string>
125 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_n.png"),
126 Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_checkbox_bg_p.png")
128 BackgroundImageBorder = (Rectangle)6,
129 Text = new TextLabelStyle
131 Text = "Select an item",
132 PointSize = StyleManager.PointSizeNormal,
133 TextColor = Color.Black,
135 Icon = new ImageViewStyle
137 Size = new Size(28, 28),
138 ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_dropdown_button_icon.png"),
140 IconRelativeOrientation = Button.IconOrientation.Right,
143 ListBackgroundImage = new ImageViewStyle
145 ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_dropdown_list_bg.png"),
146 Border = (Rectangle)6,
147 Size = new Size(280, 360),
149 SpaceBetweenButtonTextAndIcon = 10,
154 protected override DropDownItemStyle GetDropDownItemStyle()
156 return new DropDownItemStyle
158 Size = new Size(360, 50),
159 BackgroundColor = new Selector<Color>
161 Pressed = new Color(0.05f, 0.63f, 0.9f, 1),
162 Selected = new Color(0.8f, 0.8f, 0.8f, 1),
163 Normal = new Color(1, 1, 1, 1),
165 Text = new TextLabelStyle
167 PointSize = StyleManager.PointSizeNormal,
168 Position = new Position(28, 0),
174 protected override PopupStyle GetPopupStyle()
176 return new PopupStyle
178 Size = new Size(500, 280),
179 BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1),
180 ImageShadow = new ImageShadow
182 Url = StyleManager.GetFrameworkResourcePath("nui_component_default_popup_shadow.png"),
183 Border = new Rectangle(24, 24, 24, 24),
184 Offset = new Vector2(-24, -24),
185 Extents = new Vector2(48, 48),
187 Title = new TextLabelStyle
190 TextColor = Color.Black,
191 PositionUsesPivotPoint = true,
192 ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
193 PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
194 HorizontalAlignment = HorizontalAlignment.Begin,
195 VerticalAlignment = VerticalAlignment.Bottom,
199 Buttons = new ButtonStyle
201 Size = new Size(0, 80),
202 PositionUsesPivotPoint = true,
203 ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
204 PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
205 BackgroundColor = new Selector<Color>
207 Normal = new Color(1, 1, 1, 1),
208 Pressed = new Color(1, 1, 1, 0.5f),
210 Overlay = new ImageViewStyle
212 PositionUsesPivotPoint = true,
213 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
214 PivotPoint = Tizen.NUI.PivotPoint.Center,
215 WidthResizePolicy = ResizePolicyType.FillToParent,
216 HeightResizePolicy = ResizePolicyType.FillToParent,
217 BackgroundColor = new Selector<Color>
219 Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),
220 Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),
221 Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),
224 Text = new TextLabelStyle
226 PositionUsesPivotPoint = true,
227 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
228 PivotPoint = Tizen.NUI.PivotPoint.Center,
229 HorizontalAlignment = HorizontalAlignment.Center,
230 VerticalAlignment = VerticalAlignment.Center,
231 TextColor = new Color(0.05f, 0.63f, 0.9f, 1)
237 protected override ProgressStyle GetProgressStyle()
239 return new ProgressStyle
241 Size = new Size(200, 5),
242 Track = new ImageViewStyle
244 BackgroundColor = new Color(0, 0, 0, 0.1f),
246 Buffer = new ImageViewStyle
248 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f)
250 Progress = new ImageViewStyle
252 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1)
257 protected override ButtonStyle GetRadioButtonStyle()
259 return new ButtonStyle
261 Size = new Size(30, 30),
262 Icon = new ImageViewStyle
264 WidthResizePolicy = ResizePolicyType.DimensionDependency,
265 HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
266 SizeModeFactor = new Vector3(1, 1, 1),
267 Opacity = new Selector<float?>
272 DisabledSelected = 0.4f
274 BackgroundImage = new Selector<string>
276 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
277 Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_p.png"),
278 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
279 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
280 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
283 Text = new TextLabelStyle
285 PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
286 WidthResizePolicy = ResizePolicyType.FillToParent,
287 HeightResizePolicy = ResizePolicyType.FillToParent,
288 HorizontalAlignment = HorizontalAlignment.Center,
289 VerticalAlignment = VerticalAlignment.Center,
290 TextColor = new Selector<Color>
292 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
293 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
294 Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
300 protected override SliderStyle GetSliderStyle()
302 return new SliderStyle
304 Size = new Size(200, 50),
306 Track = new ImageViewStyle
308 BackgroundColor = new Color(0, 0, 0, 0.1f),
311 Progress = new ImageViewStyle
313 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
316 Thumb = new ImageViewStyle
318 Size = new Size(50, 50),
319 ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_n.png"),
320 BackgroundImage = new Selector<string>
323 Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_bg_p.png"),
330 protected override SwitchStyle GetSwitchStyle()
332 return new SwitchStyle
334 Size = new Size(96, 60),
335 Track = new ImageViewStyle
337 Size = new Size(96, 60),
338 ResourceUrl = new Selector<string>
340 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_n.png"),
341 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_s.png"),
342 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_d.png"),
343 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_ds.png"),
345 Border = new Rectangle(30, 30, 30, 30),
347 Thumb = new ImageViewStyle
349 Size = new Size(60, 60),
350 ResourceUrl = new Selector<string>
352 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
353 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
354 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
355 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
358 Text = new TextLabelStyle
360 PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
361 WidthResizePolicy = ResizePolicyType.FillToParent,
362 HeightResizePolicy = ResizePolicyType.FillToParent,
363 HorizontalAlignment = HorizontalAlignment.Center,
364 VerticalAlignment = VerticalAlignment.Center,
365 TextColor = new Selector<Color>
367 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
368 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
369 Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
375 protected override TabStyle GetTabStyle()
379 BackgroundColor = Color.Yellow,
380 Size = new Size(480, 80),
381 UnderLine = new ViewStyle
383 Size = new Size(0, 6),
384 PositionUsesPivotPoint = true,
385 ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
386 PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
387 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
389 Text = new TextLabelStyle
391 PointSize = StyleManager.PointSizeTitle,
392 TextColor = new Selector<Color>
394 Normal = Color.Black,
395 Selected = new Color(0.05f, 0.63f, 0.9f, 1),
401 protected override ToastStyle GetToastStyle()
403 return new ToastStyle
405 WidthResizePolicy = ResizePolicyType.FitToChildren,
406 HeightResizePolicy = ResizePolicyType.FitToChildren,
407 BackgroundColor = new Color(0, 0, 0, 0.8f),
408 Text = new TextLabelStyle()
410 PositionUsesPivotPoint = true,
411 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
412 PivotPoint = Tizen.NUI.PivotPoint.Center,
413 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
414 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
415 HorizontalAlignment = HorizontalAlignment.Center,
416 VerticalAlignment = VerticalAlignment.Center,
417 TextColor = Color.White,
418 Padding = new Extents(12, 12, 8, 8),
423 protected override LoadingStyle GetLoadingStyle()
425 return new LoadingStyle
427 LoadingSize = new Size(100, 100)
431 protected override PaginationStyle GetPaginationStyle()
433 return new PaginationStyle
435 IndicatorImageURL = new Selector<string>()
437 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
438 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),