Set LV_COLOR_SCREEN_TRANSP when transform_angle used

This commit is contained in:
clydebarrow 2024-09-19 08:37:31 +10:00
parent 1596a85e4f
commit ab826f1fa5
2 changed files with 5 additions and 1 deletions

View file

@ -52,7 +52,7 @@ from .types import (
lv_style_t,
lvgl_ns,
)
from .widgets import Widget, add_widgets, lv_scr_act, set_obj_properties
from .widgets import Widget, add_widgets, lv_scr_act, set_obj_properties, styles_used
from .widgets.animimg import animimg_spec
from .widgets.arc import arc_spec
from .widgets.button import button_spec
@ -279,6 +279,8 @@ async def to_code(config):
for comp in helpers.lvgl_components_required:
CORE.add_define(f"USE_LVGL_{comp.upper()}")
if "transform_angle" in styles_used:
add_define("LV_COLOR_SCREEN_TRANSP", "1")
for use in helpers.lv_uses:
add_define(f"LV_USE_{use.upper()}")
lv_conf_h_file = CORE.relative_src_path(LV_CONF_FILENAME)

View file

@ -52,6 +52,7 @@ from ..types import LV_STATE, LvType, WidgetType, lv_coord_t, lv_obj_t, lv_obj_t
EVENT_LAMB = "event_lamb__"
theme_widget_map = {}
styles_used = set()
class LvScrActType(WidgetType):
@ -158,6 +159,7 @@ class Widget:
def set_style(self, prop, value, state):
if value is None:
return
styles_used.add(prop)
lv.call(f"obj_set_style_{prop}", self.obj, value, state)
def __type_base(self):