mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-02 17:47:28 +08:00
fix(xml): fix grid support (#8888)
This commit is contained in:
committed by
GitHub
parent
095e923e28
commit
784e1eebc3
@@ -1357,6 +1357,34 @@ color_filter_opa
|
||||
|
||||
The intensity of mixing of color filter.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<ul>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> `LV_OPA_TRANSP`</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Layout</strong> No</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
|
||||
</ul>
|
||||
|
||||
recolor
|
||||
~~~~~~~
|
||||
|
||||
Set a color to mix to the obj.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<ul>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> `0x000000`</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Layout</strong> No</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
|
||||
</ul>
|
||||
|
||||
recolor_opa
|
||||
~~~~~~~~~~~
|
||||
|
||||
Sets the intensity of color mixing. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent. A value of 255, `LV_OPA_100` or `LV_OPA_COVER` means fully opaque. Intermediate values like LV_OPA_10, LV_OPA_20, etc result in semi-transparency.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<ul>
|
||||
@@ -1622,7 +1650,7 @@ Set column in which Widget should be placed.
|
||||
.. raw:: html
|
||||
|
||||
<ul>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> `LV_GRID_ALIGN_START`</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Layout</strong> Yes</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
|
||||
@@ -1650,7 +1678,7 @@ Set how many columns Widget should span. Needs to be >= 1.
|
||||
.. raw:: html
|
||||
|
||||
<ul>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> `LV_GRID_ALIGN_START`</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 1</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Layout</strong> Yes</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
|
||||
@@ -1664,7 +1692,7 @@ Set row in which Widget should be placed.
|
||||
.. raw:: html
|
||||
|
||||
<ul>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> `LV_GRID_ALIGN_START`</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 0</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Layout</strong> Yes</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
|
||||
@@ -1692,7 +1720,7 @@ Set how many rows Widget should span. Needs to be >= 1.
|
||||
.. raw:: html
|
||||
|
||||
<ul>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> `LV_GRID_ALIGN_START`</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Default</strong> 1</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Inherited</strong> No</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Layout</strong> Yes</li>
|
||||
<li style='display:inline-block; margin-right: 20px; margin-left: 0px'><strong>Ext. draw</strong> No</li>
|
||||
|
||||
@@ -395,7 +395,7 @@ props = [
|
||||
|
||||
{'name': 'RECOLOR_OPA',
|
||||
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_TRANSP`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
'dsc': "Set intensity of color mixing. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
|
||||
'dsc': "Sets the intensity of color mixing. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent. A value of 255, `LV_OPA_100` or `LV_OPA_COVER` means fully opaque. Intermediate values like LV_OPA_10, LV_OPA_20, etc result in semi-transparency."},
|
||||
|
||||
{'name': 'ANIM',
|
||||
'style_type': 'ptr', 'var_type': 'const lv_anim_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
|
||||
@@ -478,7 +478,7 @@ props = [
|
||||
'dsc': "Defines how to distribute the rows."},
|
||||
|
||||
{'name': 'GRID_CELL_COLUMN_POS',
|
||||
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
|
||||
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
|
||||
'dsc': "Set column in which Widget should be placed."},
|
||||
|
||||
{'name': 'GRID_CELL_X_ALIGN',
|
||||
@@ -486,11 +486,11 @@ props = [
|
||||
'dsc': "Set how to align Widget horizontally."},
|
||||
|
||||
{'name': 'GRID_CELL_COLUMN_SPAN',
|
||||
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
|
||||
'style_type': 'num', 'var_type': 'int32_t', 'default':1, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
|
||||
'dsc': "Set how many columns Widget should span. Needs to be >= 1."},
|
||||
|
||||
{'name': 'GRID_CELL_ROW_POS',
|
||||
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
|
||||
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
|
||||
'dsc': "Set row in which Widget should be placed."},
|
||||
|
||||
{'name': 'GRID_CELL_Y_ALIGN',
|
||||
@@ -498,7 +498,7 @@ props = [
|
||||
'dsc': "Set how to align Widget vertically."},
|
||||
|
||||
{'name': 'GRID_CELL_ROW_SPAN',
|
||||
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
|
||||
'style_type': 'num', 'var_type': 'int32_t', 'default':1, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
|
||||
'dsc': "Set how many rows Widget should span. Needs to be >= 1."},
|
||||
]
|
||||
|
||||
@@ -747,7 +747,7 @@ print('''\
|
||||
''')
|
||||
print('#endif /* LV_STYLE_GEN_H */')
|
||||
|
||||
sys.stdout = open(base_dir + '/../docs/details/base-widget/styles/style-properties.rst', 'w')
|
||||
sys.stdout = open(base_dir + '/../docs/src/details/common-widget-features/styles/style-properties.rst', 'w')
|
||||
|
||||
print('.. _style_properties:')
|
||||
print()
|
||||
|
||||
@@ -474,6 +474,15 @@ lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop)
|
||||
return (lv_style_value_t) {
|
||||
.num = 256
|
||||
};
|
||||
|
||||
#if LV_USE_GRID
|
||||
case LV_STYLE_GRID_CELL_ROW_SPAN:
|
||||
case LV_STYLE_GRID_CELL_COLUMN_SPAN:
|
||||
return (lv_style_value_t) {
|
||||
.num = 1
|
||||
};
|
||||
#endif
|
||||
|
||||
default:
|
||||
return (lv_style_value_t) {
|
||||
.ptr = NULL
|
||||
|
||||
@@ -283,8 +283,8 @@ lv_result_t lv_xml_style_register(lv_xml_component_scope_t * scope, const char *
|
||||
else SET_STYLE_IF(grid_cell_row_pos, lv_xml_atoi(value));
|
||||
else SET_STYLE_IF(grid_cell_row_span, lv_xml_atoi(value));
|
||||
else SET_STYLE_IF(grid_cell_y_align, lv_xml_grid_align_to_enum(value));
|
||||
else if(lv_streq(name, "style_grid_column_dsc_array") ||
|
||||
lv_streq(name, "style_grid_row_dsc_array")) {
|
||||
else if(lv_streq(name, "grid_column_dsc_array") ||
|
||||
lv_streq(name, "grid_row_dsc_array")) {
|
||||
|
||||
uint32_t item_cnt = 0;
|
||||
uint32_t c;
|
||||
@@ -312,7 +312,7 @@ lv_result_t lv_xml_style_register(lv_xml_component_scope_t * scope, const char *
|
||||
}
|
||||
dsc_array[item_cnt] = LV_GRID_TEMPLATE_LAST;
|
||||
|
||||
if(lv_streq(name, "style_grid_column_dsc_array")) {
|
||||
if(lv_streq(name, "grid_column_dsc_array")) {
|
||||
lv_style_set_grid_column_dsc_array(style, dsc_array);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user