mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
lv_btn: fix warning
This commit is contained in:
parent
523170297e
commit
8b29a88b58
@ -606,21 +606,6 @@ static lv_res_t lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param)
|
|||||||
} else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) {
|
} else if(c == LV_KEY_LEFT || c == LV_KEY_DOWN) {
|
||||||
if(lv_btn_get_toggle(btn)) lv_btn_set_state(btn, LV_BTN_STATE_REL);
|
if(lv_btn_get_toggle(btn)) lv_btn_set_state(btn, LV_BTN_STATE_REL);
|
||||||
}
|
}
|
||||||
// else if(c == LV_KEY_ENTER) {
|
|
||||||
// if(lv_btn_get_toggle(btn)) {
|
|
||||||
// if(state == LV_BTN_STATE_REL || state == LV_BTN_STATE_PR)
|
|
||||||
// lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL); else if(state ==
|
|
||||||
// LV_BTN_STATE_TGL_REL || state == LV_BTN_STATE_TGL_PR)
|
|
||||||
// lv_btn_set_state(btn, LV_BTN_STATE_REL);
|
|
||||||
// } else {
|
|
||||||
// if(state == LV_BTN_STATE_REL || state == LV_BTN_STATE_PR)
|
|
||||||
// lv_btn_set_state(btn, LV_BTN_STATE_REL); else if(state ==
|
|
||||||
// LV_BTN_STATE_TGL_REL || state == LV_BTN_STATE_TGL_PR)
|
|
||||||
// lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL);
|
|
||||||
// }
|
|
||||||
// res = lv_obj_send_event(btn, LV_EVENT_VALUE_CHANGED);
|
|
||||||
// if(res != LV_RES_OK) return res;
|
|
||||||
// }
|
|
||||||
} else if(sign == LV_SIGNAL_CLEANUP) {
|
} else if(sign == LV_SIGNAL_CLEANUP) {
|
||||||
#if LV_USE_ANIMATION && LV_BTN_INK_EFFECT
|
#if LV_USE_ANIMATION && LV_BTN_INK_EFFECT
|
||||||
if(btn == ink_obj) {
|
if(btn == ink_obj) {
|
||||||
@ -671,20 +656,20 @@ static void lv_btn_ink_effect_anim_ready(lv_anim_t * a)
|
|||||||
|
|
||||||
if((state == LV_BTN_STATE_REL || state == LV_BTN_STATE_TGL_REL) && ext->toggle == 0 &&
|
if((state == LV_BTN_STATE_REL || state == LV_BTN_STATE_TGL_REL) && ext->toggle == 0 &&
|
||||||
ink_playback == false) {
|
ink_playback == false) {
|
||||||
lv_anim_t a;
|
lv_anim_t new_a;
|
||||||
a.var = ink_obj;
|
new_a.var = ink_obj;
|
||||||
a.start = LV_BTN_INK_VALUE_MAX;
|
new_a.start = LV_BTN_INK_VALUE_MAX;
|
||||||
a.end = 0;
|
new_a.end = 0;
|
||||||
a.exec_cb = (lv_anim_exec_cb_t)lv_btn_ink_effect_anim;
|
new_a.exec_cb = (lv_anim_exec_cb_t)lv_btn_ink_effect_anim;
|
||||||
a.path_cb = lv_anim_path_linear;
|
new_a.path_cb = lv_anim_path_linear;
|
||||||
a.ready_cb = lv_btn_ink_effect_anim_ready;
|
new_a.ready_cb = lv_btn_ink_effect_anim_ready;
|
||||||
a.act_time = -ext->ink_wait_time;
|
new_a.act_time = -ext->ink_wait_time;
|
||||||
a.time = ext->ink_out_time;
|
new_a.time = ext->ink_out_time;
|
||||||
a.playback = 0;
|
new_a.playback = 0;
|
||||||
a.playback_pause = 0;
|
new_a.playback_pause = 0;
|
||||||
a.repeat = 0;
|
new_a.repeat = 0;
|
||||||
a.repeat_pause = 0;
|
new_a.repeat_pause = 0;
|
||||||
lv_anim_create(&a);
|
lv_anim_create(&new_a);
|
||||||
|
|
||||||
ink_playback = true;
|
ink_playback = true;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user