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 Extents = new Vector2(48, 48),
186 Title = new TextLabelStyle
189 TextColor = Color.Black,
190 PositionUsesPivotPoint = true,
191 ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft,
192 PivotPoint = Tizen.NUI.PivotPoint.TopLeft,
193 HorizontalAlignment = HorizontalAlignment.Begin,
194 VerticalAlignment = VerticalAlignment.Bottom,
198 Buttons = new ButtonStyle
200 Size = new Size(0, 80),
201 PositionUsesPivotPoint = true,
202 ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
203 PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
204 BackgroundColor = new Selector<Color>
206 Normal = new Color(1, 1, 1, 1),
207 Pressed = new Color(1, 1, 1, 0.5f),
209 Overlay = new ImageViewStyle
211 PositionUsesPivotPoint = true,
212 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
213 PivotPoint = Tizen.NUI.PivotPoint.Center,
214 WidthResizePolicy = ResizePolicyType.FillToParent,
215 HeightResizePolicy = ResizePolicyType.FillToParent,
216 BackgroundColor = new Selector<Color>
218 Normal = new Color(1.0f, 1.0f, 1.0f, 1.0f),
219 Pressed = new Color(0.0f, 0.0f, 0.0f, 0.1f),
220 Selected = new Color(1.0f, 1.0f, 1.0f, 1.0f),
223 Text = new TextLabelStyle
225 PositionUsesPivotPoint = true,
226 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
227 PivotPoint = Tizen.NUI.PivotPoint.Center,
228 HorizontalAlignment = HorizontalAlignment.Center,
229 VerticalAlignment = VerticalAlignment.Center,
230 TextColor = new Color(0.05f, 0.63f, 0.9f, 1)
236 protected override ProgressStyle GetProgressStyle()
238 return new ProgressStyle
240 Size = new Size(200, 5),
241 Track = new ImageViewStyle
243 BackgroundColor = new Color(0, 0, 0, 0.1f),
245 Buffer = new ImageViewStyle
247 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 0.3f)
249 Progress = new ImageViewStyle
251 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1)
256 protected override ButtonStyle GetRadioButtonStyle()
258 return new ButtonStyle
260 Size = new Size(30, 30),
261 Icon = new ImageViewStyle
263 WidthResizePolicy = ResizePolicyType.DimensionDependency,
264 HeightResizePolicy = ResizePolicyType.SizeRelativeToParent,
265 SizeModeFactor = new Vector3(1, 1, 1),
266 Opacity = new Selector<float?>
271 DisabledSelected = 0.4f
273 BackgroundImage = new Selector<string>
275 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
276 Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_p.png"),
277 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
278 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_n.png"),
279 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_radiobutton_s.png"),
282 Text = new TextLabelStyle
284 PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
285 WidthResizePolicy = ResizePolicyType.FillToParent,
286 HeightResizePolicy = ResizePolicyType.FillToParent,
287 HorizontalAlignment = HorizontalAlignment.Center,
288 VerticalAlignment = VerticalAlignment.Center,
289 TextColor = new Selector<Color>
291 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
292 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
293 Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
299 protected override SliderStyle GetSliderStyle()
301 return new SliderStyle
303 Size = new Size(200, 50),
305 Track = new ImageViewStyle
307 BackgroundColor = new Color(0, 0, 0, 0.1f),
310 Progress = new ImageViewStyle
312 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
315 Thumb = new ImageViewStyle
317 Size = new Size(50, 50),
318 ResourceUrl = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_n.png"),
319 BackgroundImage = new Selector<string>
322 Pressed = StyleManager.GetFrameworkResourcePath("nui_component_default_slider_thumb_bg_p.png"),
329 protected override SwitchStyle GetSwitchStyle()
331 return new SwitchStyle
333 Size = new Size(96, 60),
334 Track = new ImageViewStyle
336 Size = new Size(96, 60),
337 WidthResizePolicy = ResizePolicyType.Fixed,
338 HeightResizePolicy = ResizePolicyType.Fixed,
339 ResourceUrl = new Selector<string>
341 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_n.png"),
342 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_s.png"),
343 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_d.png"),
344 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_ds.png"),
346 Border = new Rectangle(30, 30, 30, 30),
348 Thumb = new ImageViewStyle
350 Size = new Size(60, 60),
351 ResourceUrl = new Selector<string>
353 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
354 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
355 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
356 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
359 Text = new TextLabelStyle
361 PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
362 WidthResizePolicy = ResizePolicyType.FillToParent,
363 HeightResizePolicy = ResizePolicyType.FillToParent,
364 HorizontalAlignment = HorizontalAlignment.Center,
365 VerticalAlignment = VerticalAlignment.Center,
366 TextColor = new Selector<Color>
368 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
369 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
370 Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
376 protected override TabStyle GetTabStyle()
380 BackgroundColor = Color.Yellow,
381 Size = new Size(480, 80),
382 UnderLine = new ViewStyle
384 Size = new Size(0, 6),
385 PositionUsesPivotPoint = true,
386 ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
387 PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
388 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
390 Text = new TextLabelStyle
392 PointSize = StyleManager.PointSizeTitle,
393 TextColor = new Selector<Color>
395 Normal = Color.Black,
396 Selected = new Color(0.05f, 0.63f, 0.9f, 1),
402 protected override ToastStyle GetToastStyle()
404 return new ToastStyle
406 WidthResizePolicy = ResizePolicyType.FitToChildren,
407 HeightResizePolicy = ResizePolicyType.FitToChildren,
408 BackgroundColor = new Color(0, 0, 0, 0.8f),
409 Text = new TextLabelStyle()
411 PositionUsesPivotPoint = true,
412 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
413 PivotPoint = Tizen.NUI.PivotPoint.Center,
414 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
415 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
416 HorizontalAlignment = HorizontalAlignment.Center,
417 VerticalAlignment = VerticalAlignment.Center,
418 TextColor = Color.White,
419 Padding = new Extents(12, 12, 8, 8),
424 protected override LoadingStyle GetLoadingStyle()
426 return new LoadingStyle
428 LoadingSize = new Size(100, 100)
432 protected override PaginationStyle GetPaginationStyle()
434 return new PaginationStyle
436 IndicatorImageUrl = new Selector<string>()
438 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
439 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),