[dali_2.3.19] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / docs / content / programming-guide / styling.h
1 /*! \page styling Styling
2  *
3 @section styling-controls Styling Controls
4
5 DALi Controls can be styled to look and behaviour differently.
6
7 There are 2 ways to style a control, 1 is recommended.
8
9 1) json markup in one of the style files.
10
11 ~~~
12       ...
13       "control":
14       {
15         "filename":"{IMAGES}file_name.png"
16       },
17       ...
18 ~~~
19
20 or 2) via code using SetProperty
21
22 @code
23 Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
24 control.SetProperty( Control::BACKGROUND, "file_name.png" );
25 @endcode
26
27 By setting the properties in the json file and not in code it prevents the need to edit code and recompile if changes required.
28
29 In the example above, if the png file needs to be changed, method 1 only requires the json file to be changed and no actual code change.
30
31 @section choosing-style-at-build Choosing Style files at build time
32
33 When building for a target, a style selector should be specified.
34
35 The selectors are resolution biased e.g; 720 and 480.
36
37 Below can be added to configure to select a style
38
39 @code
40 ./configure --with-style=480
41 @endcode
42
43 @code
44 ./configure --with-style=720
45 @endcode
46
47
48 or for gbs the below define added to the build command
49
50 @code
51 --define "dali_style 480x800"
52 @endcode
53
54 @section resources-for-styling Style specific resources
55
56 Each style selector can have resource folders associated with it.
57
58 Images for that style should be in their own folder named images.
59
60 Common images not specific for a particular style will be in the images-common folder located in the style folder.
61
62 All application resources are stored in a defined path (application resource path), from this path sub directories can be specified.
63
64 The application resource path  can be retrieved using Application::GetResourcePath()
65
66 Alternatively to supply resource paths in json the following constant is available: APPLICATION_RESOURCE_PATH.
67
68 It provides the path to the  application resource root folder, from there the filename can an be specified along with any sub folders, e.g Images, Models etc.
69
70
71 *
72 */