Skip to content

Commit

Permalink
fix(btnmatrix) do not show pressed, focused or focus key states on di…
Browse files Browse the repository at this point in the history
…sabled buttons
  • Loading branch information
kisvegabor committed Sep 17, 2021
1 parent fba37a3 commit 3df2a74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widgets/lv_btnmatrix.c
Expand Up @@ -653,7 +653,6 @@ static void draw_main(lv_event_t * e)
lv_draw_rect_dsc_t draw_rect_dsc_def;
lv_draw_label_dsc_t draw_label_dsc_def;


lv_state_t state_ori = obj->state;
obj->state = LV_STATE_DEFAULT;
obj->skip_trans = 1;
Expand Down Expand Up @@ -694,8 +693,9 @@ static void draw_main(lv_event_t * e)
/*Get the state of the button*/
lv_state_t btn_state = LV_STATE_DEFAULT;
if(button_get_checked(btnm->ctrl_bits[btn_i])) btn_state |= LV_STATE_CHECKED;

if(button_is_inactive(btnm->ctrl_bits[btn_i])) btn_state |= LV_STATE_DISABLED;
if(btn_i == btnm->btn_id_sel) {
else if(btn_i == btnm->btn_id_sel) {
if(state_ori & LV_STATE_PRESSED) btn_state |= LV_STATE_PRESSED;
if(state_ori & LV_STATE_FOCUSED) btn_state |= LV_STATE_FOCUSED;
if(state_ori & LV_STATE_FOCUS_KEY) btn_state |= LV_STATE_FOCUS_KEY;
Expand Down

0 comments on commit 3df2a74

Please sign in to comment.