I am very new to coding, sorry if this is trivial.
Description
I want to change the font size of the tabs I am using. I am using the Material theme. My first attempt got me close. I think I am copying the default style and not the material theme style. Maybe there is a better way?
What MCU/Processor/Board and compiler are you using?
ESP32 Dev board with an ILI9341 display
PlatformIO on Windows 10
Couldn’t get the simulator to work
What do you want to achieve?
Increase Font Size of tabs to make symbols bigger
What have you tried so far?
Based on this https://github.com/littlevgl/lvgl/issues/628
I added these lines
// TMC Change Button Font Size by changing style
static lv_style_t style_tv_btn_rel;
lv_style_copy(&style_tv_btn_rel, &lv_style_btn_rel);
style_tv_btn_rel.text.font = &lv_font_roboto_28;
lv_tabview_set_style(tabview, LV_TABVIEW_STYLE_BTN_REL, &style_tv_btn_rel);
Code to reproduce
To this:
/*Create a Tab view object*/
lv_obj_t *tabview;
tabview = lv_tabview_create(lv_scr_act(), NULL);
// TMC Change Button Font Size by changing style
static lv_style_t style_tv_btn_rel;
lv_style_copy(&style_tv_btn_rel, &lv_style_btn_rel);
style_tv_btn_rel.text.font = &lv_font_roboto_28;
lv_tabview_set_style(tabview, LV_TABVIEW_STYLE_BTN_REL, &style_tv_btn_rel);
/*Add 3 tabs (the tabs are page (lv_page) and can be scrolled*/
lv_tabview_set_btns_pos(tabview, LV_TABVIEW_BTNS_POS_LEFT); // TMC Changed BTNs To left side
lv_obj_t *tab1 = lv_tabview_add_tab(tabview, LV_SYMBOL_VOLUME_MAX); // TMC Changed Text to Symbol
lv_obj_t *tab2 = lv_tabview_add_tab(tabview, LV_SYMBOL_SETTINGS); // TMC Changed Text to Symbol
lv_obj_t *tab3 = lv_tabview_add_tab(tabview, LV_SYMBOL_DOWNLOAD); // TMC Changed Text to Symbol
/*Add content to the tabs*/
lv_obj_t * label = lv_label_create(tab1, NULL);
lv_label_set_text(label, "This the first tab\n\n"
"If the content\n"
"of a tab\n"
"become too long\n"
"the it \n"
"automatically\n"
"become\n"
"scrollable.");
label = lv_label_create(tab2, NULL);
lv_label_set_text(label, "Second tab");
label = lv_label_create(tab3, NULL);
lv_label_set_text(label, "Third tab");
Screenshot and/or video
Before
After
Thanks for any help