Description
I create a page with some buttons on this page.
And create a new transparent layer
for receiving some signals to resize the page
by set this new layer to LV_PROTECT_PARENT | LV_PROTECT_PRESS_LOST …
and set the layer’s parent again back to the page’s bg.
( As the page’s property, the buttons’ parent is automatically
moved to the page’ scrollable-container.
But the layer’s parent is set back to the page’ bg container )
As this scenario
when draging signal occur,
I can receive some the layer’s signal to resize the page already.
But if the layer is pressed, I want to send this pressed-signal
from the layer to the buttons on the page
that under the layer too.
how to send this signal to the button under the layer?
Thank you.
What MCU/Processor/Board and compiler are you using?
- ESP32
What do you want to achieve?
Send pressed signal on the layer that cover the page
to the button under the layer too.
What have you tried so far?
Code to reproduce
lv_obj_t* page = lv_page_create(lv_scr_act(), NULL);
lv_obj_set_size( page, 240,240);
lv_page_set_scrl_layout( page, LV_LAYOUT_GRID);
lv_obj_t* btn1 = lv_btn_create( page, NULL);
lv_obj_t* btn2 = lv_btn_create( page, NULL);
lv_obj_t* btn3 = lv_btn_create( page, NULL);
lv_obj_t* layer = lv_cont_create( page, NULL);
lv_obj_set_protect(layer, LV_PROTECT_PARENT | LV_PROTECT_PRESS_LOST );
lv_obj_set_parent(layer, page);
lv_obj_move_foreground(layer);
lv_obj_set_style(layer, &lv_style_transp);
lv_cont_set_fit( layer, LV_FIT_FLOOD);
lv_obj_set_drag( layer, true);
lv_obj_set_drag_throw( layer, true);
lv_obj_align( layer, page, LV_ALIGN_CENTER,0,0);
....
static lv_res_t layer_signal(lv_obj_t * op_resizer, lv_signal_t sign, void * param)
{
....
if( sign == LV_SIGNAL_PRESSED || sign == LV_SIGNAL_PRESSING ) {
... // draging to change size of the page
... // how to send these signal to the buttons too ?
}
....
}