mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[lvgl] Fix msgbox content (#7912)
This commit is contained in:
		| @@ -29,7 +29,7 @@ from ..lvcode import ( | ||||
| ) | ||||
| from ..schemas import STYLE_SCHEMA, STYLED_TEXT_SCHEMA, container_schema, part_schema | ||||
| from ..types import LV_EVENT, char_ptr, lv_obj_t | ||||
| from . import Widget, set_obj_properties | ||||
| from . import Widget, add_widgets, set_obj_properties | ||||
| from .button import button_spec | ||||
| from .buttonmatrix import ( | ||||
|     BUTTONMATRIX_BUTTON_SCHEMA, | ||||
| @@ -119,6 +119,7 @@ async def msgbox_to_code(top_layer, conf): | ||||
|         button_style = {CONF_ITEMS: button_style} | ||||
|         await set_obj_properties(buttonmatrix_widget, button_style) | ||||
|     await set_obj_properties(msgbox_widget, conf) | ||||
|     await add_widgets(msgbox_widget, conf) | ||||
|     async with LambdaContext(EVENT_ARG, where=messagebox_id) as close_action: | ||||
|         outer_widget.add_flag("LV_OBJ_FLAG_HIDDEN") | ||||
|     if close_button: | ||||
|   | ||||
| @@ -109,6 +109,10 @@ lvgl: | ||||
|       close_button: true | ||||
|       title: Messagebox | ||||
|       bg_color: 0xffff | ||||
|       widgets: | ||||
|         - label: | ||||
|             text: Hello Msgbox | ||||
|             id: msgbox_label | ||||
|       body: | ||||
|         text: This is a sample messagebox | ||||
|         bg_color: 0x808080 | ||||
| @@ -137,6 +141,9 @@ lvgl: | ||||
|         - lvgl.widget.focus: mark | ||||
|         - lvgl.widget.redraw: hello_label | ||||
|         - lvgl.widget.redraw: | ||||
|         - lvgl.label.update: | ||||
|             id: msgbox_label | ||||
|             text: Unloaded | ||||
|       on_all_events: | ||||
|         logger.log: | ||||
|           format: "Event %s" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user