GUI: Widget view extra options for JS (#4120)

* Fill option for widget frame
* Add widget circle element
* Add widget line element
* Fix missing include for InputType
* Fix missing comment
* Update api symbols
* Load .fxbm from file
* Fix copy pasta
* Add fill param to example
* Fix some comments
* Bump JS SDK 0.3
* Fix free
* Rename widget frame to rect
* Gui: add widget_add_frame_element backward compatibility macros

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
WillyJL
2025-02-21 01:47:56 +00:00
committed by GitHub
parent 16d18a79a9
commit 404764b660
16 changed files with 360 additions and 72 deletions

View File

@@ -195,14 +195,27 @@ void widget_add_icon_element(Widget* widget, uint8_t x, uint8_t y, const Icon* i
widget_add_element(widget, icon_element);
}
void widget_add_frame_element(
void widget_add_rect_element(
Widget* widget,
uint8_t x,
uint8_t y,
uint8_t width,
uint8_t height,
uint8_t radius) {
uint8_t radius,
bool fill) {
furi_check(widget);
WidgetElement* frame_element = widget_element_frame_create(x, y, width, height, radius);
widget_add_element(widget, frame_element);
WidgetElement* rect_element = widget_element_rect_create(x, y, width, height, radius, fill);
widget_add_element(widget, rect_element);
}
void widget_add_circle_element(Widget* widget, uint8_t x, uint8_t y, uint8_t radius, bool fill) {
furi_check(widget);
WidgetElement* circle_element = widget_element_circle_create(x, y, radius, fill);
widget_add_element(widget, circle_element);
}
void widget_add_line_element(Widget* widget, uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) {
furi_check(widget);
WidgetElement* line_element = widget_element_line_create(x1, y1, x2, y2);
widget_add_element(widget, line_element);
}