Styling fixes for paper displays (#514)
This commit is contained in:
@@ -227,6 +227,7 @@ lv_obj_t* toolbar_add_switch_action(lv_obj_t* obj) {
|
||||
|
||||
lv_obj_t* widget = lv_switch_create(wrapper);
|
||||
lv_obj_set_align(widget, LV_ALIGN_CENTER);
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
@@ -238,6 +239,12 @@ lv_obj_t* toolbar_add_spinner_action(lv_obj_t* obj) {
|
||||
|
||||
auto* spinner = spinner_create(wrapper);
|
||||
lv_obj_set_align(spinner, LV_ALIGN_CENTER);
|
||||
|
||||
if (lv_display_get_color_format(lv_obj_get_display(obj)) == LV_COLOR_FORMAT_L8) {
|
||||
lv_obj_set_style_image_recolor(spinner, lv_theme_get_color_secondary(obj), LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_image_recolor_opa(spinner, LV_OPA_COVER, LV_STATE_DEFAULT);
|
||||
}
|
||||
|
||||
return spinner;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,13 @@ lv_obj_t* __wrap_lv_dropdown_create(lv_obj_t* parent) {
|
||||
lv_obj_set_style_pad_all(dropdown, 2, LV_STATE_DEFAULT);
|
||||
}
|
||||
|
||||
lv_obj_set_style_border_width(dropdown, 1, LV_PART_MAIN);
|
||||
if (lv_display_get_color_format(lv_obj_get_display(parent)) == LV_COLOR_FORMAT_L8) {
|
||||
lv_obj_set_style_border_color(dropdown, lv_theme_get_color_secondary(parent), LV_PART_MAIN);
|
||||
} else {
|
||||
lv_obj_set_style_border_color(dropdown, lv_color_hex(0xFAFAFA), LV_PART_MAIN);
|
||||
}
|
||||
|
||||
return dropdown;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,10 @@ lv_obj_t* __wrap_lv_switch_create(lv_obj_t* parent) {
|
||||
lv_obj_set_style_size(widget, 25, 15, LV_STATE_DEFAULT);
|
||||
}
|
||||
|
||||
if (lv_display_get_color_format(lv_obj_get_display(parent)) == LV_COLOR_FORMAT_L8) {
|
||||
lv_obj_set_style_bg_color(widget, lv_theme_get_color_secondary(parent), LV_PART_MAIN);
|
||||
}
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,11 @@ lv_obj_t* __wrap_lv_textarea_create(lv_obj_t* parent) {
|
||||
gui_service->keyboardAddTextArea(textarea);
|
||||
}
|
||||
|
||||
if (lv_display_get_color_format(lv_obj_get_display(parent)) == LV_COLOR_FORMAT_L8) {
|
||||
lv_obj_set_style_border_width(textarea, 1, LV_PART_MAIN);
|
||||
lv_obj_set_style_border_color(textarea, lv_theme_get_color_secondary(parent), LV_PART_MAIN);
|
||||
}
|
||||
|
||||
return textarea;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user