Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HASPmota support for spangroup (styled text) #20852

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

s-hadinger
Copy link
Collaborator

Description:

Fixed LVGL support for spangroup, and extended HASPmota to support spangroup.

Spangroup is equivalent to HTML <span> and allows to have a text area composed of multiple fragments, each fragment with its own style, size, font, color...

haspmota_spangroup

The spangroup above was obtained with:

{"id":11,"obj":"spangroup","x":0,"y":60,"w":300,"h":115,"text_font":"montserrat-20","bg_color":"#000088","bg_opa":255}
  {"id":12,"obj":"span","parentid":11,"text":"This is "}
  {"id":13,"obj":"span","parentid":11,"text":"RED","text_color":"#FF0000","text_font":"montserrat-28"}
  {"id":12,"obj":"span","parentid":11,"text":"and this is "}
  {"id":14,"obj":"span","parentid":11,"text":"GREEN","text_color":"#00FF00","text_font":"montserrat-28","text_decor":1}
  {"id":15,"obj":"span","parentid":11,"text":" underlined"}
  {"id":16,"obj":"span","parentid":11,"text":"\nAnd this is almost transparent","text_opa":100}

You must first define a spangroup object, and add as many as span sub-objects. You need to define the parentid attribute to the spangroup.

Note: span are parsed in the order in the jsonl file, not by id number.

Text from span can be updated via rules, like normal HASPmota text.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.6
  • The code change is tested and works with Tasmota core ESP32 V.2.0.14
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@s-hadinger s-hadinger merged commit 27ccf04 into arendst:development Mar 3, 2024
64 checks passed
@s-hadinger s-hadinger mentioned this pull request Mar 3, 2024
6 tasks
@s-hadinger s-hadinger deleted the haspmota_spangroup branch January 6, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant