chore(style_gen): update style gen script to generate .mdx (#10042)
Arduino Lint / lint (push) Has been cancelled
Build Examples with C++ Compiler / build-examples (push) Has been cancelled
MicroPython CI / Build esp32 port (push) Has been cancelled
MicroPython CI / Build rp2 port (push) Has been cancelled
MicroPython CI / Build stm32 port (push) Has been cancelled
MicroPython CI / Build unix port (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_NORMAL_8BIT - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_SDL - Ubuntu (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_16BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_24BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - cl - Windows (push) Has been cancelled
C/C++ CI / Build OPTIONS_FULL_32BIT - gcc - Windows (push) Has been cancelled
C/C++ CI / Build ESP IDF ESP32S3 (push) Has been cancelled
C/C++ CI / Run tests with 32bit build (push) Has been cancelled
C/C++ CI / Run tests with 64bit build (push) Has been cancelled
BOM Check / bom-check (push) Has been cancelled
Verify that lv_conf_internal.h matches repository state / verify-conf-internal (push) Has been cancelled
Verify GDB constants are up-to-date / verify-gdb-consts (push) Has been cancelled
Verify the widget property name / verify-property-name (push) Has been cancelled
Verify code formatting / verify-formatting (push) Has been cancelled
Compare file templates with file names / template-check (push) Has been cancelled
Build Docs / build-and-deploy (push) Has been cancelled
Test API JSON generator / Test API JSON (push) Has been cancelled
Install LVGL using CMake / build-examples (push) Has been cancelled
Check Makefile / Build using Makefile (push) Has been cancelled
Check Makefile for UEFI / Build using Makefile for UEFI (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/benchmark_results_comment/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/filter_docker_logs/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Script Check (scripts/perf/tests/serialize_results/test.sh) (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark 32b - lv_conf_perf32b (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark 64b - lv_conf_perf64b (push) Has been cancelled
Emulated Performance Test / ARM Emulated Benchmark - Save PR Number (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_32B - Ubuntu (push) Has been cancelled
Performance Tests CI / Perf Tests OPTIONS_TEST_PERF_64B - Ubuntu (push) Has been cancelled
Port repo release update / run-release-branch-updater (push) Has been cancelled
Verify Font License / verify-font-license (push) Has been cancelled
Verify Kconfig / verify-kconfig (push) Has been cancelled
Hardware Performance Test / Hardware Performance Benchmark (push) Has been cancelled
Hardware Performance Test / HW Benchmark - Save PR Number (push) Has been cancelled

This commit is contained in:
André Costa
2026-05-04 22:21:57 +02:00
committed by GitHub
parent aebad7ccbf
commit 1e12358523
4 changed files with 143 additions and 303 deletions
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -1291,9 +1291,9 @@ static inline int32_t lv_obj_get_style_blur_radius(const lv_obj_t * obj, lv_part
}
/**
* If `true` the background of the widget will be blurred. The part should have < 100%
* opacity to make it visible. If `false` the given part will be blurred when it's
* rendered but before drawing the children.
* If `true` the background of the widget will be blurred. The part should have less
* than 100% opacity to make it visible. If `false` the given part will be blurred
* when it's rendered but before drawing the children.
* Default: `false`, inherited: No, layout: No, ext. draw: No.
* @param obj Pointer to Widget
* @param part One of the `LV_PART_...` enum values
@@ -3042,9 +3042,9 @@ void lv_obj_set_style_text_leading_trim(lv_obj_t * obj, lv_text_leading_trim_t v
void lv_obj_set_style_blur_radius(lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
/**
* If `true` the background of the widget will be blurred. The part should have < 100%
* opacity to make it visible. If `false` the given part will be blurred when it's
* rendered but before drawing the children.
* If `true` the background of the widget will be blurred. The part should have less
* than 100% opacity to make it visible. If `false` the given part will be blurred
* when it's rendered but before drawing the children.
* Default: `false`, inherited: No, layout: No, ext. draw: No.
* @param obj Pointer to Widget
* @param value Value to submit
+6 -6
View File
@@ -798,9 +798,9 @@ void lv_style_set_text_leading_trim(lv_style_t * style, lv_text_leading_trim_t v
void lv_style_set_blur_radius(lv_style_t * style, int32_t value);
/**
* If `true` the background of the widget will be blurred. The part should have < 100%
* opacity to make it visible. If `false` the given part will be blurred when it's
* rendered but before drawing the children.
* If `true` the background of the widget will be blurred. The part should have less
* than 100% opacity to make it visible. If `false` the given part will be blurred
* when it's rendered but before drawing the children.
* Default: `false`, inherited: No, layout: No, ext. draw: No.
* @param style Pointer to style
* @param value Value to submit
@@ -2110,9 +2110,9 @@ void lv_style_set_grid_cell_row_span(lv_style_t * style, int32_t value);
}
/**
* If `true` the background of the widget will be blurred. The part should have < 100%
* opacity to make it visible. If `false` the given part will be blurred when it's
* rendered but before drawing the children.
* If `true` the background of the widget will be blurred. The part should have less
* than 100% opacity to make it visible. If `false` the given part will be blurred
* when it's rendered but before drawing the children.
* Default: `false`, inherited: No, layout: No, ext. draw: No.
* @param val Value to submit
*/
+34 -33
View File
@@ -5,7 +5,7 @@
- lvgl/include/lvgl/core/lv_style_gen.h
- lvgl/src/core/lv_obj_style_gen.c
- lvgl/src/misc/lv_style_gen.c
- lvgl/docs/src/common-widget-features/styles/style-properties.rst
- lvgl/docs/src/common-widget-features/styles/style-properties.mdx
This script effectively "factors out" what would be duplicate code and
documentation in all 5 of the above files, into 1 place: below.
@@ -315,7 +315,7 @@ props = [
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set opacity of lines."},
{'section': 'Arc', 'dsc':'TODO' },
{'section': 'Arc', 'dsc':'Properties to describe the Arc Widget' },
{'name': 'ARC_WIDTH',
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set width (thickness) of arcs in pixels."},
@@ -388,7 +388,7 @@ props = [
{'name': 'BLUR_BACKDROP',
'style_type': 'num', 'var_type': 'bool', 'default':'`false`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "If `true` the background of the widget will be blurred. The part should have < 100% opacity to make it visible. If `false` the given part will be blurred when it's rendered but before drawing the children."},
'dsc': "If `true` the background of the widget will be blurred. The part should have less than 100% opacity to make it visible. If `false` the given part will be blurred when it's rendered but before drawing the children."},
{'name': 'BLUR_QUALITY',
'style_type': 'num', 'var_type': 'lv_blur_quality_t', 'default':'`LV_BLUR_QUALITY_AUTO`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
@@ -585,11 +585,14 @@ HEADING = f'''\
'''
RST_HEADING = f'''\
.. **********************************************************************
.. DO NOT EDIT
.. This file is automatically generated by "{_cfg_this_script}"
.. **********************************************************************'''
MDX_HEADING = f'''---
title: Style Properties
description: LVGL style property reference.
---
{{/* **********************************************************************
DO NOT EDIT
This file is automatically generated by "{_cfg_this_script}"
********************************************************************** */}}'''
# =========================================================================
@@ -883,34 +886,36 @@ def local_style_set_h(p):
def docs(p):
if "section" in p:
print()
print(p['section'])
print("-" * len(p['section']))
print(f"## {p['section']}")
print()
print(p['dsc'])
return
li_style = "style='display:inline-block; margin-right: 20px; margin-left: 0px"
dsc = word_wrapped_description(p['dsc'], in_a_comment=False)
print()
name = p["name"].lower()
print(name)
print("~" * len(name))
print()
print(dsc)
if 'default' in p:
d, i, L, e = extra_info(p)
d, i, l, e = extra_info(p)
# Convert the inherited/layout/extDraw strings to JSX booleans/values
inherited_val = "true" if i.strip().lower() == "yes" else "false"
layout_val = "true" if l.strip().lower() == "yes" else "false"
ext_draw_val = "true" if e.strip().lower() == "yes" else "false"
print()
print(".. raw:: html")
print(f'<StyleProperty')
print(f' name="{name}"')
print(f' default="{d}"')
print(f' inherited={{{inherited_val}}}')
print(f' layout={{{layout_val}}}')
print(f' extDraw={{{ext_draw_val}}}')
print(f'>')
print(dsc)
print(f'</StyleProperty>')
else:
# No default info — just emit the description as plain text under a heading
print()
print(" <ul>")
print(" <li " + li_style + "'><strong>Default</strong> " + d + "</li>")
print(" <li " + li_style + "'><strong>Inherited</strong> " + i + "</li>")
print(" <li " + li_style + "'><strong>Layout</strong> " + L + "</li>")
print(" <li " + li_style + "'><strong>Ext. draw</strong> " + e + "</li>")
print(" </ul>")
print(f"### {name}")
print()
print(dsc)
def guard_proc(p):
@@ -1042,16 +1047,12 @@ print('''\
print('#endif /* LV_STYLE_GEN_H */')
# -------------------------------------------------------------------------
# style-properties.rst
# style-properties.mdx
# -------------------------------------------------------------------------
sys.stdout = open(base_dir + '/../docs/src/common-widget-features/styles/style-properties.rst', 'w')
sys.stdout = open(base_dir + '/../docs/src/common-widget-features/styles/style-properties.mdx', 'w')
print(RST_HEADING)
print('.. _style_properties:')
print(MDX_HEADING)
print()
print('================')
print('Style Properties')
print('================')
for prop in props:
docs(prop)