BigW Consortium Gitlab

Commit 22f1a01b by Gabor

lv_mbox: start/stop auto close added

parent 2cb9d8ed
...@@ -78,7 +78,7 @@ lv_obj_t * lv_app_notice_add(const char * format, ...) ...@@ -78,7 +78,7 @@ lv_obj_t * lv_app_notice_add(const char * format, ...)
lv_obj_set_opa(mbox, app_style->menu_opa); lv_obj_set_opa(mbox, app_style->menu_opa);
#if LV_APP_NOTICE_SHOW_TIME != 0 #if LV_APP_NOTICE_SHOW_TIME != 0
lv_mbox_auto_close(mbox, LV_APP_NOTICE_SHOW_TIME); lv_mbox_start_auto_close(mbox, LV_APP_NOTICE_SHOW_TIME);
#endif #endif
lv_obj_set_parent(notice_h, lv_scr_act()); lv_obj_set_parent(notice_h, lv_scr_act());
......
...@@ -156,13 +156,13 @@ bool lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param) ...@@ -156,13 +156,13 @@ bool lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
} }
break; break;
case LV_SIGNAL_LONG_PRESS: case LV_SIGNAL_LONG_PRESS:
case LV_SIGNAL_RELEASED:
#if LV_MBOX_ANIM_TIME != 0 #if LV_MBOX_ANIM_TIME != 0
lv_mbox_auto_close(mbox, 0); lv_mbox_start_auto_close(mbox, 0);
#else #else
lv_obj_del(mbox); lv_obj_del(mbox);
valid = false; valid = false;
#endif #endif
lv_dispi_wait_release(param);
break; break;
case LV_SIGNAL_STYLE_CHG: case LV_SIGNAL_STYLE_CHG:
lv_obj_set_style(ext->title, &style->title); lv_obj_set_style(ext->title, &style->title);
...@@ -289,7 +289,7 @@ lv_action_res_t lv_mbox_close_action(lv_obj_t * btn, lv_dispi_t * dispi) ...@@ -289,7 +289,7 @@ lv_action_res_t lv_mbox_close_action(lv_obj_t * btn, lv_dispi_t * dispi)
* @param mbox pointer to a message box object * @param mbox pointer to a message box object
* @param tout a time (in milliseconds) to wait before delete the message box * @param tout a time (in milliseconds) to wait before delete the message box
*/ */
void lv_mbox_auto_close(lv_obj_t * mbox, uint16_t tout) void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t tout)
{ {
#if LV_MBOX_ANIM_TIME != 0 #if LV_MBOX_ANIM_TIME != 0
/*Add shrinking animations*/ /*Add shrinking animations*/
...@@ -304,6 +304,15 @@ void lv_mbox_auto_close(lv_obj_t * mbox, uint16_t tout) ...@@ -304,6 +304,15 @@ void lv_mbox_auto_close(lv_obj_t * mbox, uint16_t tout)
#endif #endif
} }
/**
* Stop the auto. closing of message box
* @param mbox pointer to a message box object
*/
void lv_mbox_stop_auto_close(lv_obj_t * mbox)
{
anim_del(mbox, NULL);
}
/*===================== /*=====================
* Getter functions * Getter functions
*====================*/ *====================*/
......
...@@ -128,7 +128,13 @@ lv_action_res_t lv_mbox_close_action(lv_obj_t * btn, lv_dispi_t * dispi); ...@@ -128,7 +128,13 @@ lv_action_res_t lv_mbox_close_action(lv_obj_t * btn, lv_dispi_t * dispi);
* @param mbox pointer to a message box object * @param mbox pointer to a message box object
* @param tout a time (in milliseconds) to wait before delete the message box * @param tout a time (in milliseconds) to wait before delete the message box
*/ */
void lv_mbox_auto_close(lv_obj_t * mbox, uint16_t tout); void lv_mbox_start_auto_close(lv_obj_t * mbox, uint16_t tout);
/**
* Stop the auto. closing of message box
* @param mbox pointer to a message box object
*/
void lv_mbox_stop_auto_close(lv_obj_t * mbox);
/** /**
* get the title of the message box * get the title of the message box
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment