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 Color = new Color("0ea1e6"),
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 WidthResizePolicy = ResizePolicyType.Fixed,
339 HeightResizePolicy = ResizePolicyType.Fixed,
340 ResourceUrl = new Selector<string>
342 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_n.png"),
343 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_s.png"),
344 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_d.png"),
345 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_track_ds.png"),
347 Border = new Rectangle(30, 30, 30, 30),
349 Thumb = new ImageViewStyle
351 Size = new Size(60, 60),
352 ResourceUrl = new Selector<string>
354 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
355 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_n.png"),
356 Disabled = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
357 DisabledSelected = StyleManager.GetFrameworkResourcePath("nui_component_default_switch_thumb_d.png"),
360 Text = new TextLabelStyle
362 PointSize = new Selector<float?> { All = StyleManager.PointSizeNormal },
363 WidthResizePolicy = ResizePolicyType.FillToParent,
364 HeightResizePolicy = ResizePolicyType.FillToParent,
365 HorizontalAlignment = HorizontalAlignment.Center,
366 VerticalAlignment = VerticalAlignment.Center,
367 TextColor = new Selector<Color>
369 Normal = new Color(0.22f, 0.22f, 0.22f, 1),
370 Pressed = new Color(0.11f, 0.11f, 0.11f, 1),
371 Disabled = new Color(0.66f, 0.66f, 0.66f, 1)
377 protected override TabStyle GetTabStyle()
381 BackgroundColor = Color.Yellow,
382 Size = new Size(480, 80),
383 UnderLine = new ViewStyle
385 Size = new Size(0, 6),
386 PositionUsesPivotPoint = true,
387 ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft,
388 PivotPoint = Tizen.NUI.PivotPoint.BottomLeft,
389 BackgroundColor = new Color(0.05f, 0.63f, 0.9f, 1),
391 Text = new TextLabelStyle
393 PointSize = StyleManager.PointSizeTitle,
394 TextColor = new Selector<Color>
396 Normal = Color.Black,
397 Selected = new Color(0.05f, 0.63f, 0.9f, 1),
403 protected override ToastStyle GetToastStyle()
405 return new ToastStyle
407 WidthResizePolicy = ResizePolicyType.FitToChildren,
408 HeightResizePolicy = ResizePolicyType.FitToChildren,
409 BackgroundColor = new Color(0, 0, 0, 0.8f),
410 Text = new TextLabelStyle()
412 PositionUsesPivotPoint = true,
413 ParentOrigin = Tizen.NUI.ParentOrigin.Center,
414 PivotPoint = Tizen.NUI.PivotPoint.Center,
415 WidthResizePolicy = ResizePolicyType.UseNaturalSize,
416 HeightResizePolicy = ResizePolicyType.UseNaturalSize,
417 HorizontalAlignment = HorizontalAlignment.Center,
418 VerticalAlignment = VerticalAlignment.Center,
419 TextColor = Color.White,
420 Padding = new Extents(12, 12, 8, 8),
425 protected override LoadingStyle GetLoadingStyle()
427 return new LoadingStyle
429 LoadingSize = new Size(100, 100)
433 protected override PaginationStyle GetPaginationStyle()
435 return new PaginationStyle
437 IndicatorImageUrl = new Selector<string>()
439 Normal = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_normal_dot.png"),
440 Selected = StyleManager.GetFrameworkResourcePath("nui_component_default_pagination_focus_dot.png"),