mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
material theme minor improvements
This commit is contained in:
parent
2500c65506
commit
a760baa869
@ -393,10 +393,10 @@ static void slider_init(void)
|
||||
lv_style_set_bg_color(&slider_knob, LV_STATE_DEFAULT, IS_LIGHT ? theme.color_primary : LV_COLOR_WHITE);
|
||||
lv_style_set_value_color(&slider_knob, LV_STATE_DEFAULT, IS_LIGHT ? lv_color_hex(0x31404f) : LV_COLOR_WHITE);
|
||||
lv_style_set_radius(&slider_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
|
||||
lv_style_set_pad_left(&slider_knob, LV_STATE_DEFAULT, LV_DPX(10));
|
||||
lv_style_set_pad_right(&slider_knob, LV_STATE_DEFAULT, LV_DPX(10));
|
||||
lv_style_set_pad_top(&slider_knob, LV_STATE_DEFAULT, LV_DPX(10));
|
||||
lv_style_set_pad_bottom(&slider_knob, LV_STATE_DEFAULT, LV_DPX(10));
|
||||
lv_style_set_pad_left(&slider_knob, LV_STATE_DEFAULT, LV_DPX(7));
|
||||
lv_style_set_pad_right(&slider_knob, LV_STATE_DEFAULT, LV_DPX(7));
|
||||
lv_style_set_pad_top(&slider_knob, LV_STATE_DEFAULT, LV_DPX(7));
|
||||
lv_style_set_pad_bottom(&slider_knob, LV_STATE_DEFAULT, LV_DPX(7));
|
||||
|
||||
style_init_reset(&slider_bg);
|
||||
lv_style_set_margin_left(&slider_bg, LV_STATE_DEFAULT, LV_DPX(15));
|
||||
@ -414,10 +414,10 @@ static void switch_init(void)
|
||||
lv_style_set_bg_opa(&sw_knob, LV_STATE_DEFAULT, LV_OPA_COVER);
|
||||
lv_style_set_bg_color(&sw_knob, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
||||
lv_style_set_radius(&sw_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
|
||||
lv_style_set_pad_top(&sw_knob, LV_STATE_DEFAULT, - LV_DPX(8));
|
||||
lv_style_set_pad_bottom(&sw_knob, LV_STATE_DEFAULT, - LV_DPX(8));
|
||||
lv_style_set_pad_left(&sw_knob, LV_STATE_DEFAULT, - LV_DPX(8));
|
||||
lv_style_set_pad_right(&sw_knob, LV_STATE_DEFAULT, - LV_DPX(8));
|
||||
lv_style_set_pad_top(&sw_knob, LV_STATE_DEFAULT, - LV_DPX(4));
|
||||
lv_style_set_pad_bottom(&sw_knob, LV_STATE_DEFAULT, - LV_DPX(4));
|
||||
lv_style_set_pad_left(&sw_knob, LV_STATE_DEFAULT, - LV_DPX(4));
|
||||
lv_style_set_pad_right(&sw_knob, LV_STATE_DEFAULT, - LV_DPX(4));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ lv_obj_t * lv_switch_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
if(copy == NULL) {
|
||||
lv_obj_set_click(sw, true);
|
||||
lv_obj_add_protect(sw, LV_PROTECT_PRESS_LOST);
|
||||
lv_obj_set_size(sw, LV_DPX(70), LV_DPX(40));
|
||||
lv_obj_set_size(sw, LV_DPX(60), LV_DPX(35));
|
||||
lv_bar_set_range(sw, 0, 1);
|
||||
|
||||
lv_theme_apply(sw, LV_THEME_SWITCH);
|
||||
|
Loading…
x
Reference in New Issue
Block a user