diff --git a/src/ui/include/themes.hpp b/src/ui/include/themes.hpp index 576ea42e..11680c0d 100644 --- a/src/ui/include/themes.hpp +++ b/src/ui/include/themes.hpp @@ -32,6 +32,7 @@ class Theme { lv_style_t button_style_; lv_style_t bar_style_; lv_style_t dropdown_style_; + lv_style_t dropdown_list_style_; lv_style_t slider_indicator_style_; lv_style_t slider_knob_style_; diff --git a/src/ui/themes.cpp b/src/ui/themes.cpp index bad73ee6..f8390570 100644 --- a/src/ui/themes.cpp +++ b/src/ui/themes.cpp @@ -89,6 +89,14 @@ Theme::Theme() { lv_style_set_border_color(&dropdown_style_, lv_palette_main(LV_PALETTE_BLUE)); lv_style_set_border_side(&dropdown_style_, LV_BORDER_SIDE_FULL); + lv_style_init(&dropdown_list_style_); + lv_style_set_radius(&dropdown_list_style_, 2); + lv_style_set_border_width(&dropdown_list_style_, 1); + lv_style_set_border_color(&dropdown_list_style_, lv_palette_main(LV_PALETTE_BLUE_GREY)); + lv_style_set_bg_opa(&dropdown_list_style_, LV_OPA_COVER); + lv_style_set_bg_color(&dropdown_list_style_, lv_color_white()); + lv_style_set_pad_all(&dropdown_list_style_, 2); + lv_theme_t* parent_theme = lv_disp_get_theme(NULL); theme_ = *parent_theme; theme_.user_data = this; @@ -124,6 +132,8 @@ void Theme::Callback(lv_obj_t* obj) { lv_obj_add_style(obj, &switch_knob_style_, LV_PART_KNOB); } else if (lv_obj_check_type(obj, &lv_dropdown_class)) { lv_obj_add_style(obj, &dropdown_style_, LV_PART_MAIN); + } else if (lv_obj_check_type(obj, &lv_dropdownlist_class)) { + lv_obj_add_style(obj, &dropdown_list_style_, LV_PART_MAIN); } }