Lines Matching full:a

8 heavily inspired by CSS. The concept in a nutshell is that a
10 border width, font, text color and so on. It's similar to a ``class`` in CSS.
15 ``style_blue`` to the knob of a slider when it's in pressed state.
17 - Styles can be cascaded which means multiple styles may be assigned to a Widget and
19 have to be specified in a style. LVGL will search for a property until a
20 style defines it or use a default value if it's not specified by any of the
21 styles. For example ``style_btn`` can result in a default gray button
22 and ``style_btn_red`` can add only a ``background-color=red`` to
24 - The most recently added style has higher precedence. This means if a property
26 - Some properties (e.g. text color) can be inherited from a parent(s) if it's not specified in a Wi…
29 in LVGL a property is assigned to a given state.
55 A Widget can be in a combination of states such as being focused and
58 A style can be added to any state or state combination. For example,
59 setting a different background color for the default and pressed states.
60 If a property is not defined in a state the best matching state's
67 States have a precedence which is shown by their value (see in the above list).
68 A higher value means higher precedence. To determine which state's
76 1. Initially the Widget is in the default state, so it's a simple case:
93 the background color for this state. So for lack of a better option,
99 user would expect naturally. Example: if a Widget has focus the user will still
100 want to see if it's pressed, therefore the pressed state has a higher
101 precedence. If the focused state had a higher precedence it would overwrite
103 - If you want to set a property for all states (e.g. red background color)
104 just set it for the default state. If the Widget can't find a property
108 - It might be a good idea to use different
113 states and indicate the focused state with a different border color.
123 to add more styles to a Widget and have the latter added style modify
124 or extend appearance. For example, create a general gray button style
125 and create a new one for red buttons where only the new background color
141 will be red because a perfect match is found in the most recently added
142 style (red). When the button is pressed the light-gray color is a better
157 searched up the parent hierarchy until a Widget specifies a value for the
159 So if a button is pressed, and the text color comes from a parent, the
173 - :cpp:enumerator:`LV_PART_MAIN`: A background like rectangle
176 - :cpp:enumerator:`LV_PART_KNOB`: Like a handle to grab to adjust a value
179 - :cpp:enumerator:`LV_PART_CURSOR`: Mark a specific place e.g. Text Area's or chart's cursor
182 For example a :ref:`Slider <lv_slider>` has three parts:
201 exits. Before using a style it should be initialized with
202 :cpp:expr:`lv_style_init(&my_style)`. After initializing a style, properties can
222 To remove a property use:
228 To get a property's value from a style:
245 To reset a style (free all its data) use:
270 Add and remove styles to a widget
273 A style on its own has no effect until it is added (assigned) to a Widget.
279 To add a style to a Widget use
300 To replace a specific style of a Widget use
315 lv_obj_add_style(btn, &style_btn, 0); /* Add a button style */
316 …lv_obj_replace_style(btn, &style_btn, &new_style_btn, 0); /* Replace the button style with a diff…
321 To remove all styles from a Widget use :cpp:expr:`lv_obj_remove_style_all(widget)`.
334 If a style which is already assigned to a Widget changes (i.e. a
338 1. If you know that the changed properties can be applied by a simple redraw
344 3. To make LVGL check all Widgets to see if they use a style and refresh them
346 is ``NULL`` all Widgets will be notified about a style change.
348 Get a style property's value on a Widget
351 To get the final value of a style's property considering
379 customization to a Widget.
384 To set a local property use functions like
427 By default, when a Widget changes state (e.g. it's pressed) the new
430 example, on pressing a button its background color can be animated to
442 setting a 500 ms transition time in the default state means that when
443 the Widget goes to the default state a 500 ms transition time is
444 applied. Setting a 100 ms transition time in the pressed state causes a
449 To describe a transition an :cpp:struct:`lv_transition_dsc_t` variable needs to be
450 initialized and added to a style:
473 ``transform_zoom`` properties are set to a non-default value LVGL
474 creates a snapshot of the widget and its children in order to
482 If only ``opa`` and/or ``blend_mode`` is set to a non-default value LVGL
497 case ARGB rendering needs to be used, a widget might not cover its area
518 Themes are a collection of styles. If there is an active theme LVGL
519 applies it to every newly-created widget. This will give a default appearance
522 Every display can have a different theme. For example, you could have a
523 colorful theme on a TFT and monochrome theme on a secondary monochrome
526 To set a theme for a display, two steps are required:
528 1. Initialize a theme
529 2. Assign the initialized theme to a display.
548 and sets it when a display is created.
553 Built-in themes can be extended. If a custom theme is created, a parent