I see now and I can suggest 2 things:
- The less elegant method: Use
lv_obj_remove_styleto remove the style(s) you don’t need.lv_obj_remove_style_allremoves all styles so you can build it from scratch (not that internally the x, y, width, and height are also local style properties so they will be also removed withlv_obj_remove_style_all) - The pro method: Let’s say you want to add
style_redwhenstateistrue. You can addstyle_redto theLV_STATE_USER_1and uselv_obj_add/clear_state(obj, LV_STATE_USER_1)depending onstatein thePRESSEDevent.