Skip to content

Commit 485109a

Browse files
committed
hide instead of disable
1 parent ac17093 commit 485109a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/gsmenu/helper.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ lv_obj_t * create_dropdown(lv_obj_t * parent, const char * icon, const char * la
524524
lv_dropdown_set_dir(dd, LV_DIR_RIGHT);
525525
lv_dropdown_set_symbol(dd, LV_SYMBOL_RIGHT);
526526
lv_obj_set_width(dd,300); // someone got a better idea ?
527-
lv_obj_add_state(dd, LV_STATE_DISABLED);
528527

529528
lv_obj_add_style(dd, &style_openipc_outline, LV_PART_MAIN | LV_STATE_FOCUS_KEY);
530529
lv_obj_add_style(dd, &style_openipc_dark_background, LV_PART_MAIN | LV_STATE_DEFAULT);
@@ -864,8 +863,8 @@ void get_dropdown_value(lv_obj_t * parent) {
864863
thread_data_t * param_user_data = (thread_data_t*) lv_obj_get_user_data(obj);
865864
lv_dropdown_set_options(obj,get_values(param_user_data));
866865
update_dropdown_width(obj);
867-
if (lv_dropdown_get_option_cnt(obj) > 1)
868-
lv_obj_remove_state(obj, LV_STATE_DISABLED);
866+
if (lv_dropdown_get_option_cnt(obj) == 1)
867+
lv_obj_add_flag(lv_obj_get_parent(obj), LV_OBJ_FLAG_HIDDEN);
869868
}
870869

871870
bool file_exists(const char *path) {

0 commit comments

Comments
 (0)