acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
lv_example_style_13.c (1012B)
1 #include "../lv_examples.h" 2 #if LV_BUILD_EXAMPLES && LV_USE_IMG 3 4 /** 5 * Add styles to parts and states 6 */ 7 void lv_example_style_13(void) 8 { 9 static lv_style_t style_indic; 10 lv_style_init(&style_indic); 11 lv_style_set_bg_color(&style_indic, lv_palette_lighten(LV_PALETTE_RED, 3)); 12 lv_style_set_bg_grad_color(&style_indic, lv_palette_main(LV_PALETTE_RED)); 13 lv_style_set_bg_grad_dir(&style_indic, LV_GRAD_DIR_HOR); 14 15 static lv_style_t style_indic_pr; 16 lv_style_init(&style_indic_pr); 17 lv_style_set_shadow_color(&style_indic_pr, lv_palette_main(LV_PALETTE_RED)); 18 lv_style_set_shadow_width(&style_indic_pr, 10); 19 lv_style_set_shadow_spread(&style_indic_pr, 3); 20 21 /*Create an object with the new style_pr*/ 22 lv_obj_t * obj = lv_slider_create(lv_scr_act()); 23 lv_obj_add_style(obj, &style_indic, LV_PART_INDICATOR); 24 lv_obj_add_style(obj, &style_indic_pr, LV_PART_INDICATOR | LV_STATE_PRESSED); 25 lv_slider_set_value(obj, 70, LV_ANIM_OFF); 26 lv_obj_center(obj); 27 } 28 29 #endif