feat(xml): add gradient support

This commit is contained in:
Gabor Kiss-Vamosi
2025-01-18 07:50:18 +01:00
parent ecfe33480b
commit b78a9b447a
13 changed files with 382 additions and 11 deletions

View File

@@ -1,4 +1,12 @@
<component>
<gradients>
<horizontal_gradient name="grad1" >
<stop color="#ff0000" frac="30%" opa="100%"/>
<stop color="#00ff00" frac="200" opa="100%"/>
</horizontal_gradient>
</gradients>
<consts>
<px name="size" value="100%"/>
</consts>
@@ -12,11 +20,11 @@
</api>
<styles>
<style name="gray" bg_color="0x888888"/>
<style name="gray" bg_grad="grad1"/>
<style name="blue" bg_color="0x0000ff"/>
</styles>
<view extends="lv_obj" style_radius="3" width="#size" height="content" style_bg_color="$bg_color" >
<view extends="lv_obj" style_radius="3" width="#size" height="content" styles="gray" style_bg_color="$bg_color" >
<lv_label text="$title" align="left_mid"/>
<my_button styles="$btn_rel_style $btn_pr_style:pressed" btn_text="$action" align="right_mid"/>
</view>

View File

@@ -10,7 +10,6 @@
</styles>
<view extends="lv_obj" width="280" height="content" style_bg_color="#light_blue">
<lv_label text="Hello"/>
<my_card title="Card 1"
y="0"
btn_rel_style="btn_style"