From ca19c7d92faa25486d518f157b279ec01389576e Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 17 May 2019 16:59:12 +0200 Subject: [PATCH] minor formatting --- src/lv_objx/lv_list.c | 6 +++++- src/lv_objx/lv_list.h | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lv_objx/lv_list.c b/src/lv_objx/lv_list.c index 6d06470a7..3e5c8de0c 100644 --- a/src/lv_objx/lv_list.c +++ b/src/lv_objx/lv_list.c @@ -288,7 +288,8 @@ void lv_list_set_single_mode(lv_obj_t * list, bool mode) /** * Make a button selected * @param list pointer to a list object - * @param btn pointer to a button to selectthe + * @param btn pointer to a button to select + * NULL to not select any buttons */ void lv_list_set_btn_selected(lv_obj_t * list, lv_obj_t * btn) { @@ -303,6 +304,9 @@ void lv_list_set_btn_selected(lv_obj_t * list, lv_obj_t * btn) } ext->selected_btn = btn; + + /*Don't forgat whci hbutton was selected. + * It will be restored when the list is focused.*/ if(btn != NULL) { ext->last_sel = btn; } diff --git a/src/lv_objx/lv_list.h b/src/lv_objx/lv_list.h index 982d6d2a1..b828884b2 100644 --- a/src/lv_objx/lv_list.h +++ b/src/lv_objx/lv_list.h @@ -58,8 +58,7 @@ typedef struct uint32_t size; /*the number of items(buttons) in the list*/ bool single_mode; /* whether single selected mode is enabled */ #if LV_USE_GROUP - lv_obj_t * - last_sel; /* The last selected button. It will be reverted when the list is focused again */ + lv_obj_t * last_sel; /* The last selected button. It will be reverted when the list is focused again */ lv_obj_t * selected_btn; /* The button is currently being selected*/ #endif } lv_list_ext_t;