fix imgbtn state change

This commit is contained in:
Gabor Kiss-Vamosi
2020-10-07 12:44:54 +02:00
parent 1d50bc962d
commit f1a198bd93
3 changed files with 34 additions and 18 deletions

View File

@@ -170,6 +170,26 @@ void lv_imgbtn_set_src_tiled(lv_obj_t * imgbtn, lv_btn_state_t state, const void
#endif
/**
* Set the state of the image button
* @param imgbtn pointer to an image button object
* @param state the new state of the button (from lv_btn_state_t enum)
*/
void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_btn_state_t state)
{
lv_btn_set_state(imgbtn, state);
refr_img(imgbtn);
}
/**
* Toggle the state of the image button (ON->OFF, OFF->ON)
* @param imgbtn pointer to a image button object
*/
void lv_imgbtn_toggle(lv_obj_t * imgbtn)
{
lv_imgbtn_toggle(imgbtn);
refr_img(imgbtn);
}
/*=====================
* Getter functions
*====================*/

View File

@@ -98,6 +98,19 @@ void lv_imgbtn_set_src_tiled(lv_obj_t * imgbtn, lv_btn_state_t state, const void
#endif
/**
* Set the state of the image button
* @param imgbtn pointer to an image button object
* @param state the new state of the button (from lv_btn_state_t enum)
*/
void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_btn_state_t state);
/**
* Toggle the state of the image button (ON->OFF, OFF->ON)
* @param imgbtn pointer to a image button object
*/
void lv_imgbtn_toggle(lv_obj_t * imgbtn);
/**
* Enable the toggled states. On release the button will change from/to toggled state.
* @param imgbtn pointer to an image button object
@@ -108,24 +121,6 @@ static inline void lv_imgbtn_set_checkable(lv_obj_t * imgbtn, bool tgl)
lv_btn_set_checkable(imgbtn, tgl);
}
/**
* Set the state of the image button
* @param imgbtn pointer to an image button object
* @param state the new state of the button (from lv_btn_state_t enum)
*/
static inline void lv_imgbtn_set_state(lv_obj_t * imgbtn, lv_btn_state_t state)
{
lv_btn_set_state(imgbtn, state);
}
/**
* Toggle the state of the image button (ON->OFF, OFF->ON)
* @param imgbtn pointer to a image button object
*/
static inline void lv_imgbtn_toggle(lv_obj_t * imgbtn)
{
lv_btn_toggle(imgbtn);
}
/*=====================
* Getter functions