From c61ca42a2a00e92512a0f1ec4225c66cb3b5b2c1 Mon Sep 17 00:00:00 2001 From: lorddevereux <74740498+lorddevereux@users.noreply.github.com> Date: Wed, 23 Oct 2024 07:28:25 +0100 Subject: [PATCH] feat(scale): add additional style properties (#6649) Co-authored-by: Gabor Kiss-Vamosi --- docs/overview/style-props.rst | 42 ++++++++++++ docs/widgets/scale.rst | 41 +++++++++--- examples/widgets/lv_example_widgets.h | 2 + examples/widgets/scale/index.rst | 15 ++++- examples/widgets/scale/lv_example_scale_8.c | 47 +++++++++++++ examples/widgets/scale/lv_example_scale_9.c | 27 ++++++++ scripts/style_api_gen.py | 12 ++++ src/core/lv_obj_style_gen.c | 24 +++++++ src/core/lv_obj_style_gen.h | 39 +++++++---- src/misc/lv_style.h | 3 + src/misc/lv_style_gen.c | 24 +++++++ src/misc/lv_style_gen.h | 18 +++++ src/widgets/property/lv_obj_property_names.h | 2 +- src/widgets/property/lv_style_properties.c | 5 +- src/widgets/property/lv_style_properties.h | 3 + src/widgets/scale/lv_scale.c | 70 +++++++++++++++++--- src/widgets/scale/lv_scale.h | 9 +++ 17 files changed, 348 insertions(+), 35 deletions(-) create mode 100644 examples/widgets/scale/lv_example_scale_8.c create mode 100644 examples/widgets/scale/lv_example_scale_9.c diff --git a/docs/overview/style-props.rst b/docs/overview/style-props.rst index 0bc50fbcf0..93b44ad049 100644 --- a/docs/overview/style-props.rst +++ b/docs/overview/style-props.rst @@ -194,6 +194,20 @@ translate_y Move the object with this value in Y direction. Applied after layouts, aligns and other positioning. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's height. +.. raw:: html + + + +translate_radial +~~~~~~~~~~~~~~~~ + +Move the object around the centre of the parent object (e.g. around the circumference of a scale) + .. raw:: html +pad_radial +~~~~~~~~~~ + +Pad the text labels away from the scale ticks/remainder of the LV_PART_ + +.. raw:: html + + + Margin ------ @@ -1201,6 +1229,20 @@ radius Set the radius on every corner. The value is interpreted in pixel (>= 0) or `LV_RADIUS_CIRCLE` for max. radius +.. raw:: html + + + +radial_offset +~~~~~~~~~~~~~ + +Move the start point of the object (e.g. scale tick) radially + .. raw:: html