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_bar_5.c (969B)
1 #include "../../lv_examples.h" 2 #if LV_USE_BAR && LV_BUILD_EXAMPLES 3 4 /** 5 * Bar with LTR and RTL base direction 6 */ 7 void lv_example_bar_5(void) 8 { 9 lv_obj_t * label; 10 11 12 lv_obj_t * bar_ltr = lv_bar_create(lv_scr_act()); 13 lv_obj_set_size(bar_ltr, 200, 20); 14 lv_bar_set_value(bar_ltr, 70, LV_ANIM_OFF); 15 lv_obj_align(bar_ltr, LV_ALIGN_CENTER, 0, -30); 16 17 label = lv_label_create(lv_scr_act()); 18 lv_label_set_text(label, "Left to Right base direction"); 19 lv_obj_align_to(label, bar_ltr, LV_ALIGN_OUT_TOP_MID, 0, -5); 20 21 lv_obj_t * bar_rtl = lv_bar_create(lv_scr_act()); 22 lv_obj_set_style_base_dir(bar_rtl, LV_BASE_DIR_RTL, 0); 23 lv_obj_set_size(bar_rtl, 200, 20); 24 lv_bar_set_value(bar_rtl, 70, LV_ANIM_OFF); 25 lv_obj_align(bar_rtl, LV_ALIGN_CENTER, 0, 30); 26 27 label = lv_label_create(lv_scr_act()); 28 lv_label_set_text(label, "Right to Left base direction"); 29 lv_obj_align_to(label, bar_rtl, LV_ALIGN_OUT_TOP_MID, 0, -5); 30 } 31 32 #endif