mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-10 04:37:55 +08:00
fix(obj): style opa of other part is not effective (#7905)
Signed-off-by: yushuailong <yushuailong1@xiaomi.com> Signed-off-by: yushuailong1 <yushuailong1@xiaomi.com> Co-authored-by: yushuailong1 <yushuailong1@xiaomi.com>
This commit is contained in:
@@ -379,7 +379,11 @@ static inline lv_opa_t get_layer_opa(const lv_obj_t * obj, lv_part_t part, const
|
||||
{
|
||||
if(base_dsc->layer) {
|
||||
/* Accessing the layer opa directly is faster than using get style opa recursive */
|
||||
return base_dsc->layer->opa;
|
||||
if(part == LV_PART_MAIN) {
|
||||
return base_dsc->layer->opa;
|
||||
}
|
||||
|
||||
return LV_OPA_MIX2(base_dsc->layer->opa, lv_obj_get_style_opa(obj, part));
|
||||
}
|
||||
|
||||
/* fallback to old recursive style opa */
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
@@ -24,6 +24,17 @@ static void event_handler(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
/* Function run before every test */
|
||||
}
|
||||
|
||||
void tearDown(void)
|
||||
{
|
||||
/* Function run after every test */
|
||||
lv_obj_clean(lv_screen_active());
|
||||
}
|
||||
|
||||
void test_checkbox_creation_successful(void)
|
||||
{
|
||||
active_screen = lv_screen_active();
|
||||
@@ -115,4 +126,13 @@ void test_checkbox_rtl(void)
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/checkbox_rtl_1.png");
|
||||
}
|
||||
|
||||
void test_checkbox_style_opa(void)
|
||||
{
|
||||
lv_obj_t * obj = lv_checkbox_create(lv_screen_active());
|
||||
lv_obj_set_style_opa(obj, LV_OPA_0, LV_PART_INDICATOR);
|
||||
lv_obj_center(obj);
|
||||
|
||||
TEST_ASSERT_EQUAL_SCREENSHOT("widgets/checkbox_1.png");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user