moved theme styles into substructure within lv_theme_t

https://github.com/littlevgl/lvgl/issues/806
This commit is contained in:
manison
2019-02-11 09:35:06 +01:00
parent 89e8995dc4
commit 44e5cc446c
37 changed files with 1083 additions and 1081 deletions

View File

@@ -160,7 +160,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
new_obj->style_p = th->bg;
new_obj->style_p = th->style.bg;
} else {
new_obj->style_p = &lv_style_scr;
}
@@ -227,7 +227,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
/*Set appearance*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
new_obj->style_p = th->panel;
new_obj->style_p = th->style.panel;
} else {
new_obj->style_p = &lv_style_plain_color;
}

View File

@@ -80,7 +80,7 @@ lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_arc_set_style(new_arc, LV_ARC_STYLE_MAIN, th->arc);
lv_arc_set_style(new_arc, LV_ARC_STYLE_MAIN, th->style.arc);
} else {
lv_arc_set_style(new_arc, LV_ARC_STYLE_MAIN, &lv_style_plain_color);
}

View File

@@ -84,8 +84,8 @@ lv_obj_t * lv_bar_create(lv_obj_t * par, const lv_obj_t * copy)
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_bar_set_style(new_bar, LV_BAR_STYLE_BG, th->bar.bg);
lv_bar_set_style(new_bar, LV_BAR_STYLE_INDIC, th->bar.indic);
lv_bar_set_style(new_bar, LV_BAR_STYLE_BG, th->style.bar.bg);
lv_bar_set_style(new_bar, LV_BAR_STYLE_INDIC, th->style.bar.indic);
} else {
lv_obj_set_style(new_bar, &lv_style_pretty);
}

View File

@@ -123,11 +123,11 @@ lv_obj_t * lv_btn_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_btn_set_style(new_btn, LV_BTN_STYLE_REL, th->btn.rel);
lv_btn_set_style(new_btn, LV_BTN_STYLE_PR, th->btn.pr);
lv_btn_set_style(new_btn, LV_BTN_STYLE_TGL_REL, th->btn.tgl_rel);
lv_btn_set_style(new_btn, LV_BTN_STYLE_TGL_PR, th->btn.tgl_pr);
lv_btn_set_style(new_btn, LV_BTN_STYLE_INA, th->btn.ina);
lv_btn_set_style(new_btn, LV_BTN_STYLE_REL, th->style.btn.rel);
lv_btn_set_style(new_btn, LV_BTN_STYLE_PR, th->style.btn.pr);
lv_btn_set_style(new_btn, LV_BTN_STYLE_TGL_REL, th->style.btn.tgl_rel);
lv_btn_set_style(new_btn, LV_BTN_STYLE_TGL_PR, th->style.btn.tgl_pr);
lv_btn_set_style(new_btn, LV_BTN_STYLE_INA, th->style.btn.ina);
} else {
lv_obj_set_style(new_btn, ext->styles[LV_BTN_STATE_REL]);
}

View File

@@ -103,12 +103,12 @@ lv_obj_t * lv_btnm_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BG, th->btnm.bg);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_REL, th->btnm.btn.rel);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_PR, th->btnm.btn.pr);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_TGL_REL, th->btnm.btn.tgl_rel);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_TGL_PR, th->btnm.btn.tgl_pr);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_INA, th->btnm.btn.ina);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BG, th->style.btnm.bg);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_REL, th->style.btnm.btn.rel);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_PR, th->style.btnm.btn.pr);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_TGL_REL, th->style.btnm.btn.tgl_rel);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_TGL_PR, th->style.btnm.btn.tgl_pr);
lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_INA, th->style.btnm.btn.ina);
} else {
lv_obj_set_style(new_btnm, &lv_style_pretty);
}

View File

@@ -130,14 +130,14 @@ lv_obj_t * lv_calendar_create(lv_obj_t * par, const lv_obj_t * copy)
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_BG, th->calendar.bg);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_HEADER, th->calendar.header);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_HEADER_PR, th->calendar.header_pr);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_DAY_NAMES, th->calendar.day_names);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_WEEK_BOX, th->calendar.week_box);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_TODAY_BOX, th->calendar.today_box);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_HIGHLIGHTED_DAYS, th->calendar.highlighted_days);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_INACTIVE_DAYS, th->calendar.inactive_days);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_BG, th->style.calendar.bg);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_HEADER, th->style.calendar.header);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_HEADER_PR, th->style.calendar.header_pr);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_DAY_NAMES, th->style.calendar.day_names);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_WEEK_BOX, th->style.calendar.week_box);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_TODAY_BOX, th->style.calendar.today_box);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_HIGHLIGHTED_DAYS, th->style.calendar.highlighted_days);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_INACTIVE_DAYS, th->style.calendar.inactive_days);
} else {
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_BG, &lv_style_pretty);
lv_calendar_set_style(new_calendar, LV_CALENDAR_STYLE_HEADER, ext->style_header);

View File

@@ -88,12 +88,12 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_cb_set_style(new_cb, LV_CB_STYLE_BG, th->cb.bg);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_REL, th->cb.box.rel);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_PR, th->cb.box.pr);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_TGL_REL, th->cb.box.tgl_rel);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_TGL_PR, th->cb.box.tgl_pr);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_INA, th->cb.box.ina);
lv_cb_set_style(new_cb, LV_CB_STYLE_BG, th->style.cb.bg);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_REL, th->style.cb.box.rel);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_PR, th->style.cb.box.pr);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_TGL_REL, th->style.cb.box.tgl_rel);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_TGL_PR, th->style.cb.box.tgl_pr);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_INA, th->style.cb.box.ina);
} else {
lv_cb_set_style(new_cb, LV_CB_STYLE_BG, &lv_style_transp);
lv_cb_set_style(new_cb, LV_CB_STYLE_BOX_REL, &lv_style_pretty);

View File

@@ -95,7 +95,7 @@ lv_obj_t * lv_chart_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_chart_set_style(new_chart, th->chart);
lv_chart_set_style(new_chart, th->style.chart);
} else {
lv_chart_set_style(new_chart, &lv_style_pretty);
}

View File

@@ -89,7 +89,7 @@ lv_obj_t * lv_cont_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_cont_set_style(new_cont, th->cont);
lv_cont_set_style(new_cont, th->style.cont);
} else {
lv_cont_set_style(new_cont, &lv_style_pretty);
}

View File

@@ -118,9 +118,9 @@ lv_obj_t * lv_ddlist_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_BG, th->ddlist.bg);
lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SEL, th->ddlist.sel);
lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SB, th->ddlist.sb);
lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_BG, th->style.ddlist.bg);
lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SEL, th->style.ddlist.sel);
lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SB, th->style.ddlist.sb);
} else {
lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_BG, &lv_style_pretty);
lv_ddlist_set_style(new_ddlist, LV_DDLIST_STYLE_SEL, &lv_style_plain_color);

View File

@@ -95,7 +95,7 @@ lv_obj_t * lv_gauge_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_gauge_set_style(new_gauge, th->gauge);
lv_gauge_set_style(new_gauge, th->style.gauge);
} else {
lv_gauge_set_style(new_gauge, &lv_style_pretty_color);
}

View File

@@ -110,12 +110,12 @@ lv_obj_t * lv_kb_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_kb_set_style(new_kb, LV_KB_STYLE_BG, th->kb.bg);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_REL, th->kb.btn.rel);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_PR, th->kb.btn.pr);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_TGL_REL, th->kb.btn.tgl_rel);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_TGL_PR, th->kb.btn.tgl_pr);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_INA, th->kb.btn.ina);
lv_kb_set_style(new_kb, LV_KB_STYLE_BG, th->style.kb.bg);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_REL, th->style.kb.btn.rel);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_PR, th->style.kb.btn.pr);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_TGL_REL, th->style.kb.btn.tgl_rel);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_TGL_PR, th->style.kb.btn.tgl_pr);
lv_kb_set_style(new_kb, LV_KB_STYLE_BTN_INA, th->style.kb.btn.ina);
} else {
/*Let the button matrix's styles*/
}

View File

@@ -79,7 +79,7 @@ lv_obj_t * lv_led_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_led_set_style(new_led, th->led);
lv_led_set_style(new_led, th->style.led);
} else {
lv_led_set_style(new_led, &lv_style_pretty_color);
}

View File

@@ -109,14 +109,14 @@ lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_list_set_style(new_list, LV_LIST_STYLE_BG, th->list.bg);
lv_list_set_style(new_list, LV_LIST_STYLE_SCRL, th->list.scrl);
lv_list_set_style(new_list, LV_LIST_STYLE_SB, th->list.sb);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_REL, th->list.btn.rel);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_PR, th->list.btn.pr);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_TGL_REL, th->list.btn.tgl_rel);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_TGL_PR, th->list.btn.tgl_pr);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_INA, th->list.btn.ina);
lv_list_set_style(new_list, LV_LIST_STYLE_BG, th->style.list.bg);
lv_list_set_style(new_list, LV_LIST_STYLE_SCRL, th->style.list.scrl);
lv_list_set_style(new_list, LV_LIST_STYLE_SB, th->style.list.sb);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_REL, th->style.list.btn.rel);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_PR, th->style.list.btn.pr);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_TGL_REL, th->style.list.btn.tgl_rel);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_TGL_PR, th->style.list.btn.tgl_pr);
lv_list_set_style(new_list, LV_LIST_STYLE_BTN_INA, th->style.list.btn.ina);
} else {
lv_list_set_style(new_list, LV_LIST_STYLE_BG, &lv_style_transp_fit);
lv_list_set_style(new_list, LV_LIST_STYLE_SCRL, &lv_style_pretty);

View File

@@ -84,7 +84,7 @@ lv_obj_t * lv_lmeter_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_lmeter_set_style(new_lmeter, th->lmeter);
lv_lmeter_set_style(new_lmeter, th->style.lmeter);
} else {
lv_lmeter_set_style(new_lmeter, &lv_style_pretty_color);
}

View File

@@ -97,7 +97,7 @@ lv_obj_t * lv_mbox_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_mbox_set_style(new_mbox, LV_MBOX_STYLE_BG, th->mbox.bg);
lv_mbox_set_style(new_mbox, LV_MBOX_STYLE_BG, th->style.mbox.bg);
} else {
lv_mbox_set_style(new_mbox, LV_MBOX_STYLE_BG, &lv_style_pretty);
}
@@ -144,9 +144,9 @@ void lv_mbox_add_btns(lv_obj_t * mbox, const char ** btn_map, lv_btnm_action_t a
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_BG, th->mbox.btn.bg);
lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_REL, th->mbox.btn.rel);
lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_PR, th->mbox.btn.pr);
lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_BG, th->style.mbox.btn.bg);
lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_REL, th->style.mbox.btn.rel);
lv_mbox_set_style(mbox, LV_MBOX_STYLE_BTN_PR, th->style.mbox.btn.pr);
} else {
lv_btnm_set_style(ext->btnm, LV_BTNM_STYLE_BG, &lv_style_transp_fit);
}

View File

@@ -116,14 +116,14 @@ lv_obj_t * lv_page_create(lv_obj_t * par, const lv_obj_t * copy)
lv_theme_t * th = lv_theme_get_current();
if(th) {
if(par == NULL) { /*Different styles if it is screen*/
lv_page_set_style(new_page, LV_PAGE_STYLE_BG, th->bg);
lv_page_set_style(new_page, LV_PAGE_STYLE_BG, th->style.bg);
lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, &lv_style_transp);
} else {
lv_page_set_style(new_page, LV_PAGE_STYLE_BG, th->page.bg);
lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, th->page.scrl);
lv_page_set_style(new_page, LV_PAGE_STYLE_BG, th->style.page.bg);
lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, th->style.page.scrl);
}
lv_page_set_style(new_page, LV_PAGE_STYLE_SB, th->page.sb);
lv_page_set_style(new_page, LV_PAGE_STYLE_SB, th->style.page.sb);
} else {
lv_page_set_style(new_page, LV_PAGE_STYLE_BG, &lv_style_pretty_color);
lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, &lv_style_pretty);

View File

@@ -93,7 +93,7 @@ lv_obj_t * lv_preload_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_preload_set_style(new_preload, LV_PRELOAD_STYLE_MAIN, th->preload);
lv_preload_set_style(new_preload, LV_PRELOAD_STYLE_MAIN, th->style.preload);
} else {
lv_obj_set_style(new_preload, &lv_style_pretty_color);
}

View File

@@ -96,8 +96,8 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_roller_set_style(new_roller, LV_ROLLER_STYLE_BG, th->roller.bg);
lv_roller_set_style(new_roller, LV_ROLLER_STYLE_SEL, th->roller.sel);
lv_roller_set_style(new_roller, LV_ROLLER_STYLE_BG, th->style.roller.bg);
lv_roller_set_style(new_roller, LV_ROLLER_STYLE_SEL, th->style.roller.sel);
} else {
/*Let the ddlist's style*/
lv_obj_refresh_style(new_roller); /*To set scrollable size automatically*/

View File

@@ -86,9 +86,9 @@ lv_obj_t * lv_slider_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_slider_set_style(new_slider, LV_SLIDER_STYLE_BG, th->slider.bg);
lv_slider_set_style(new_slider, LV_SLIDER_STYLE_INDIC, th->slider.indic);
lv_slider_set_style(new_slider, LV_SLIDER_STYLE_KNOB, th->slider.knob);
lv_slider_set_style(new_slider, LV_SLIDER_STYLE_BG, th->style.slider.bg);
lv_slider_set_style(new_slider, LV_SLIDER_STYLE_INDIC, th->style.slider.indic);
lv_slider_set_style(new_slider, LV_SLIDER_STYLE_KNOB, th->style.slider.knob);
} else {
lv_slider_set_style(new_slider, LV_SLIDER_STYLE_KNOB, ext->style_knob);
}

View File

@@ -87,9 +87,9 @@ lv_obj_t * lv_spinbox_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_BG, th->spinbox.bg);
lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_CURSOR, th->spinbox.cursor);
lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_SB, th->spinbox.sb);
lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_BG, th->style.spinbox.bg);
lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_CURSOR, th->style.spinbox.cursor);
lv_spinbox_set_style(new_spinbox, LV_SPINBOX_STYLE_SB, th->style.spinbox.sb);
}
}
/*Copy an existing spinbox*/

View File

@@ -88,10 +88,10 @@ lv_obj_t * lv_sw_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_sw_set_style(new_sw, LV_SW_STYLE_BG, th->sw.bg);
lv_sw_set_style(new_sw, LV_SW_STYLE_INDIC, th->sw.indic);
lv_sw_set_style(new_sw, LV_SW_STYLE_KNOB_OFF, th->sw.knob_off);
lv_sw_set_style(new_sw, LV_SW_STYLE_KNOB_ON, th->sw.knob_on);
lv_sw_set_style(new_sw, LV_SW_STYLE_BG, th->style.sw.bg);
lv_sw_set_style(new_sw, LV_SW_STYLE_INDIC, th->style.sw.indic);
lv_sw_set_style(new_sw, LV_SW_STYLE_KNOB_OFF, th->style.sw.knob_off);
lv_sw_set_style(new_sw, LV_SW_STYLE_KNOB_ON, th->style.sw.knob_on);
} else {
/*Let the slider' style*/
}

View File

@@ -129,8 +129,8 @@ lv_obj_t * lv_ta_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_ta_set_style(new_ta, LV_TA_STYLE_BG, th->ta.area);
lv_ta_set_style(new_ta, LV_TA_STYLE_SB, th->ta.sb);
lv_ta_set_style(new_ta, LV_TA_STYLE_BG, th->style.ta.area);
lv_ta_set_style(new_ta, LV_TA_STYLE_SB, th->style.ta.sb);
} else {
lv_ta_set_style(new_ta, LV_TA_STYLE_BG, &lv_style_pretty);
}

View File

@@ -89,11 +89,11 @@ lv_obj_t * lv_table_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_table_set_style(new_table, LV_TABLE_STYLE_BG, th->table.bg);
lv_table_set_style(new_table, LV_TABLE_STYLE_CELL1, th->table.cell);
lv_table_set_style(new_table, LV_TABLE_STYLE_CELL2, th->table.cell);
lv_table_set_style(new_table, LV_TABLE_STYLE_CELL3, th->table.cell);
lv_table_set_style(new_table, LV_TABLE_STYLE_CELL4, th->table.cell);
lv_table_set_style(new_table, LV_TABLE_STYLE_BG, th->style.table.bg);
lv_table_set_style(new_table, LV_TABLE_STYLE_CELL1, th->style.table.cell);
lv_table_set_style(new_table, LV_TABLE_STYLE_CELL2, th->style.table.cell);
lv_table_set_style(new_table, LV_TABLE_STYLE_CELL3, th->style.table.cell);
lv_table_set_style(new_table, LV_TABLE_STYLE_CELL4, th->style.table.cell);
} else {
lv_table_set_style(new_table, LV_TABLE_STYLE_BG, &lv_style_plain_color);
}

View File

@@ -129,13 +129,13 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BG, th->tabview.bg);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_INDIC, th->tabview.indic);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_BG, th->tabview.btn.bg);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_REL, th->tabview.btn.rel);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_PR, th->tabview.btn.pr);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_TGL_REL, th->tabview.btn.tgl_rel);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_TGL_PR, th->tabview.btn.tgl_pr);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BG, th->style.tabview.bg);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_INDIC, th->style.tabview.indic);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_BG, th->style.tabview.btn.bg);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_REL, th->style.tabview.btn.rel);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_PR, th->style.tabview.btn.pr);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_TGL_REL, th->style.tabview.btn.tgl_rel);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_TGL_PR, th->style.tabview.btn.tgl_pr);
} else {
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BG, &lv_style_plain);
lv_tabview_set_style(new_tabview, LV_TABVIEW_STYLE_BTN_BG, &lv_style_transp);

View File

@@ -95,9 +95,9 @@ lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_page_set_style(new_tileview, LV_PAGE_STYLE_BG, th->tileview.bg);
lv_page_set_style(new_tileview, LV_PAGE_STYLE_SCRL, th->tileview.scrl);
lv_page_set_style(new_tileview, LV_PAGE_STYLE_SB, th->tileview.sb);
lv_page_set_style(new_tileview, LV_PAGE_STYLE_BG, th->style.tileview.bg);
lv_page_set_style(new_tileview, LV_PAGE_STYLE_SCRL, th->style.tileview.scrl);
lv_page_set_style(new_tileview, LV_PAGE_STYLE_SB, th->style.tileview.sb);
} else {
lv_page_set_style(new_tileview, LV_PAGE_STYLE_BG, &lv_style_transp_tight);
lv_page_set_style(new_tileview, LV_PAGE_STYLE_SCRL, &lv_style_transp_tight);

View File

@@ -92,13 +92,13 @@ lv_obj_t * lv_win_create(lv_obj_t * par, const lv_obj_t * copy)
/*Set the default styles*/
lv_theme_t * th = lv_theme_get_current();
if(th) {
lv_win_set_style(new_win, LV_WIN_STYLE_BG, th->win.bg);
lv_win_set_style(new_win, LV_WIN_STYLE_SB, th->win.sb);
lv_win_set_style(new_win, LV_WIN_STYLE_HEADER, th->win.header);
lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT_BG, th->win.content.bg);
lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT_SCRL, th->win.content.scrl);
lv_win_set_style(new_win, LV_WIN_STYLE_BTN_REL, th->win.btn.rel);
lv_win_set_style(new_win, LV_WIN_STYLE_BTN_PR, th->win.btn.pr);
lv_win_set_style(new_win, LV_WIN_STYLE_BG, th->style.win.bg);
lv_win_set_style(new_win, LV_WIN_STYLE_SB, th->style.win.sb);
lv_win_set_style(new_win, LV_WIN_STYLE_HEADER, th->style.win.header);
lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT_BG, th->style.win.content.bg);
lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT_SCRL, th->style.win.content.scrl);
lv_win_set_style(new_win, LV_WIN_STYLE_BTN_REL, th->style.win.btn.rel);
lv_win_set_style(new_win, LV_WIN_STYLE_BTN_PR, th->style.win.btn.pr);
} else {
lv_win_set_style(new_win, LV_WIN_STYLE_BG, &lv_style_plain);
lv_win_set_style(new_win, LV_WIN_STYLE_CONTENT_BG, &lv_style_plain);

View File

@@ -60,7 +60,7 @@ void lv_theme_set_current(lv_theme_t * th)
#if LV_THEME_LIVE_UPDATE == 0
current_theme = th;
#else
uint32_t style_num = sizeof(lv_theme_t) / sizeof(lv_style_t *); /*Number of styles in a theme*/
uint32_t style_num = sizeof(th->style) / sizeof(lv_style_t *); /*Number of styles in a theme*/
if(!inited) {
/*It's not sure `th_styles` is big enough. Check it now!*/
@@ -71,7 +71,7 @@ void lv_theme_set_current(lv_theme_t * th)
/*Initialize the style pointers `current_theme` to point to the `th_styles` style array */
uint16_t i;
lv_style_t ** cur_th_style_p = (lv_style_t **) &current_theme;
lv_style_t ** cur_th_style_p = (lv_style_t **) &current_theme.style;
for(i = 0; i < style_num; i++) {
uintptr_t adr = (uintptr_t)&th_styles[i];
memcpy(&cur_th_style_p[i], &adr, sizeof(lv_style_t *));
@@ -82,7 +82,7 @@ void lv_theme_set_current(lv_theme_t * th)
/*Copy the styles pointed by the new theme to the `th_styles` style array*/
uint16_t i;
lv_style_t ** th_style = (lv_style_t **) th;
lv_style_t ** th_style = (lv_style_t **) &th->style;
for(i = 0; i < style_num; i++) {
uintptr_t s = (uintptr_t)th_style[i];
if(s) memcpy(&th_styles[i], (void *)s, sizeof(lv_style_t));

View File

@@ -30,265 +30,267 @@ extern "C" {
**********************/
typedef struct {
lv_style_t *bg;
lv_style_t *panel;
struct {
lv_style_t *bg;
lv_style_t *panel;
#if USE_LV_CONT != 0
lv_style_t *cont;
lv_style_t *cont;
#endif
#if USE_LV_BTN != 0
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} btn;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} btn;
#endif
#if USE_LV_IMGBTN != 0
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} imgbtn;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} imgbtn;
#endif
#if USE_LV_LABEL != 0
struct {
lv_style_t *prim;
lv_style_t *sec;
lv_style_t *hint;
} label;
struct {
lv_style_t *prim;
lv_style_t *sec;
lv_style_t *hint;
} label;
#endif
#if USE_LV_IMG != 0
struct {
lv_style_t *light;
lv_style_t *dark;
} img;
struct {
lv_style_t *light;
lv_style_t *dark;
} img;
#endif
#if USE_LV_LINE != 0
struct {
lv_style_t *decor;
} line;
struct {
lv_style_t *decor;
} line;
#endif
#if USE_LV_LED != 0
lv_style_t *led;
lv_style_t *led;
#endif
#if USE_LV_BAR != 0
struct {
lv_style_t *bg;
lv_style_t *indic;
} bar;
struct {
lv_style_t *bg;
lv_style_t *indic;
} bar;
#endif
#if USE_LV_SLIDER != 0
struct {
lv_style_t *bg;
lv_style_t *indic;
lv_style_t *knob;
} slider;
struct {
lv_style_t *bg;
lv_style_t *indic;
lv_style_t *knob;
} slider;
#endif
#if USE_LV_LMETER != 0
lv_style_t *lmeter;
lv_style_t *lmeter;
#endif
#if USE_LV_GAUGE != 0
lv_style_t *gauge;
lv_style_t *gauge;
#endif
#if USE_LV_ARC != 0
lv_style_t *arc;
lv_style_t *arc;
#endif
#if USE_LV_PRELOAD != 0
lv_style_t *preload;
lv_style_t *preload;
#endif
#if USE_LV_SW != 0
struct {
lv_style_t *bg;
lv_style_t *indic;
lv_style_t *knob_off;
lv_style_t *knob_on;
} sw;
struct {
lv_style_t *bg;
lv_style_t *indic;
lv_style_t *knob_off;
lv_style_t *knob_on;
} sw;
#endif
#if USE_LV_CHART != 0
lv_style_t *chart;
lv_style_t *chart;
#endif
#if USE_LV_CALENDAR != 0
struct {
lv_style_t *bg;
lv_style_t *header;
lv_style_t *header_pr;
lv_style_t *day_names;
lv_style_t *highlighted_days;
lv_style_t *inactive_days;
lv_style_t *week_box;
lv_style_t *today_box;
} calendar;
struct {
lv_style_t *bg;
lv_style_t *header;
lv_style_t *header_pr;
lv_style_t *day_names;
lv_style_t *highlighted_days;
lv_style_t *inactive_days;
lv_style_t *week_box;
lv_style_t *today_box;
} calendar;
#endif
#if USE_LV_CB != 0
struct {
lv_style_t *bg;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} box;
} cb;
lv_style_t *bg;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} box;
} cb;
#endif
#if USE_LV_BTNM != 0
struct {
lv_style_t *bg;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} btn;
} btnm;
lv_style_t *bg;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} btn;
} btnm;
#endif
#if USE_LV_KB != 0
struct {
lv_style_t *bg;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} btn;
} kb;
lv_style_t *bg;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} btn;
} kb;
#endif
#if USE_LV_MBOX != 0
struct {
lv_style_t *bg;
struct {
lv_style_t *bg;
lv_style_t *rel;
lv_style_t *pr;
} btn;
} mbox;
struct {
lv_style_t *bg;
lv_style_t *rel;
lv_style_t *pr;
} btn;
} mbox;
#endif
#if USE_LV_PAGE != 0
struct {
lv_style_t *bg;
lv_style_t *scrl;
lv_style_t *sb;
} page;
#endif
#if USE_LV_TA != 0
struct {
lv_style_t *area;
lv_style_t *oneline;
lv_style_t *cursor;
lv_style_t *sb;
} ta;
#endif
#if USE_LV_SPINBOX != 0
struct {
lv_style_t *bg;
lv_style_t *cursor;
lv_style_t *sb;
} spinbox;
#endif
#if USE_LV_LIST
struct {
lv_style_t *bg;
lv_style_t *scrl;
lv_style_t *sb;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} btn;
} list;
#endif
#if USE_LV_DDLIST != 0
struct {
lv_style_t *bg;
lv_style_t *sel;
lv_style_t *sb;
} ddlist;
#endif
#if USE_LV_ROLLER != 0
struct {
lv_style_t *bg;
lv_style_t *sel;
} roller;
#endif
#if USE_LV_TABVIEW != 0
struct {
lv_style_t *bg;
lv_style_t *indic;
struct {
lv_style_t *bg;
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
} btn;
} tabview;
#endif
#if USE_LV_TILEVIEW != 0
struct {
lv_style_t *bg;
lv_style_t *scrl;
lv_style_t *sb;
} tileview;
#endif
#if USE_LV_TABLE != 0
struct {
lv_style_t *bg;
lv_style_t *cell;
} table;
#endif
#if USE_LV_WIN != 0
struct {
lv_style_t *bg;
lv_style_t *sb;
lv_style_t *header;
struct {
lv_style_t *bg;
lv_style_t *scrl;
} content;
struct {
lv_style_t *rel;
lv_style_t *pr;
} btn;
} win;
lv_style_t *sb;
} page;
#endif
#if USE_LV_TA != 0
struct {
lv_style_t *area;
lv_style_t *oneline;
lv_style_t *cursor;
lv_style_t *sb;
} ta;
#endif
#if USE_LV_SPINBOX != 0
struct {
lv_style_t *bg;
lv_style_t *cursor;
lv_style_t *sb;
} spinbox;
#endif
#if USE_LV_LIST
struct {
lv_style_t *bg;
lv_style_t *scrl;
lv_style_t *sb;
struct {
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
lv_style_t *ina;
} btn;
} list;
#endif
#if USE_LV_DDLIST != 0
struct {
lv_style_t *bg;
lv_style_t *sel;
lv_style_t *sb;
} ddlist;
#endif
#if USE_LV_ROLLER != 0
struct {
lv_style_t *bg;
lv_style_t *sel;
} roller;
#endif
#if USE_LV_TABVIEW != 0
struct {
lv_style_t *bg;
lv_style_t *indic;
struct {
lv_style_t *bg;
lv_style_t *rel;
lv_style_t *pr;
lv_style_t *tgl_rel;
lv_style_t *tgl_pr;
} btn;
} tabview;
#endif
#if USE_LV_TILEVIEW != 0
struct {
lv_style_t *bg;
lv_style_t *scrl;
lv_style_t *sb;
} tileview;
#endif
#if USE_LV_TABLE != 0
struct {
lv_style_t *bg;
lv_style_t *cell;
} table;
#endif
#if USE_LV_WIN != 0
struct {
lv_style_t *bg;
lv_style_t *sb;
lv_style_t *header;
struct {
lv_style_t *bg;
lv_style_t *scrl;
} content;
struct {
lv_style_t *rel;
lv_style_t *pr;
} btn;
} win;
#endif
} style;
} lv_theme_t;
/**********************

View File

@@ -129,15 +129,15 @@ static void basic_init(void)
sb.body.padding.ver = 1;
sb.body.padding.inner = LV_DPI / 15; /*Scrollbar width*/
theme.bg = &bg;
theme.panel = &panel;
theme.style.bg = &bg;
theme.style.panel = &panel;
}
static void cont_init(void)
{
#if USE_LV_CONT != 0
theme.cont = &panel;
theme.style.cont = &panel;
#endif
}
@@ -192,11 +192,11 @@ static void btn_init(void)
btn_ina.text.font = _font;
btn_ina.text.color = lv_color_hsv_to_rgb(_hue, 10, 90);
theme.btn.rel = &btn_rel;
theme.btn.pr = &btn_pr;
theme.btn.tgl_rel = &btn_trel;
theme.btn.tgl_pr = &btn_tpr;
theme.btn.ina = &btn_ina;
theme.style.btn.rel = &btn_rel;
theme.style.btn.pr = &btn_pr;
theme.style.btn.tgl_rel = &btn_trel;
theme.style.btn.tgl_pr = &btn_tpr;
theme.style.btn.ina = &btn_ina;
#endif
}
@@ -216,9 +216,9 @@ static void label_init(void)
lv_style_copy(&label_hint, &label_prim);
label_hint.text.color = lv_color_hsv_to_rgb(_hue, 20, 70);
theme.label.prim = &label_prim;
theme.label.sec = &label_sec;
theme.label.hint = &label_hint;
theme.style.label.prim = &label_prim;
theme.style.label.sec = &label_sec;
theme.style.label.hint = &label_hint;
#endif
}
@@ -250,8 +250,8 @@ static void bar_init(void)
bar_indic.body.main_color = lv_color_hsv_to_rgb(_hue, 40, 80);
bar_indic.body.grad_color = lv_color_hsv_to_rgb(_hue, 40, 80);
theme.bar.bg = &bar_bg;
theme.bar.indic = &bar_indic;
theme.style.bar.bg = &bar_bg;
theme.style.bar.indic = &bar_indic;
#endif
}
@@ -267,8 +267,8 @@ static void img_init(void)
img_light.image.color = lv_color_hsv_to_rgb(_hue, 85, 65);
img_light.image.intense = LV_OPA_80;
theme.img.light = &img_light;
theme.img.dark = &img_dark;
theme.style.img.light = &img_light;
theme.style.img.dark = &img_dark;
#endif
}
@@ -280,7 +280,7 @@ static void line_init(void)
line_decor.line.color = lv_color_hsv_to_rgb(_hue, 50, 50);
line_decor.line.width = 1;
theme.line.decor = &line_decor;
theme.style.line.decor = &line_decor;
#endif
}
@@ -298,7 +298,7 @@ static void led_init(void)
led.body.border.color = lv_color_hsv_to_rgb(_hue, 60, 60);
led.body.shadow.color = lv_color_hsv_to_rgb(_hue, 100, 100);
theme.led = &led;
theme.style.led = &led;
#endif
}
@@ -314,9 +314,9 @@ static void slider_init(void)
slider_knob.body.border.color = LV_COLOR_GRAY;
slider_knob.body.border.opa = LV_OPA_50;
theme.slider.bg = &bar_bg;
theme.slider.indic = &bar_indic;
theme.slider.knob = &slider_knob;
theme.style.slider.bg = &bar_bg;
theme.style.slider.indic = &bar_indic;
theme.style.slider.knob = &slider_knob;
#endif
}
@@ -341,10 +341,10 @@ static void sw_init(void)
lv_style_copy(&sw_knob, &slider_knob);
sw_knob.body.opa = LV_OPA_80;
theme.sw.bg = &sw_bg;
theme.sw.indic = &sw_indic;
theme.sw.knob_off = &sw_knob;
theme.sw.knob_on = &sw_knob;
theme.style.sw.bg = &sw_bg;
theme.style.sw.indic = &sw_indic;
theme.style.sw.knob_off = &sw_knob;
theme.style.sw.knob_on = &sw_knob;
#endif
}
@@ -359,7 +359,7 @@ static void lmeter_init(void)
lmeter_bg.line.color = LV_COLOR_HEX3(0x222);
lmeter_bg.line.width = 2;
theme.lmeter = &lmeter_bg;
theme.style.lmeter = &lmeter_bg;
#endif
}
@@ -380,7 +380,7 @@ static void gauge_init(void)
gauge_bg.text.color = lv_color_hsv_to_rgb(_hue, 10, 90);
gauge_bg.text.font = _font;
theme.gauge = &gauge_bg;
theme.style.gauge = &gauge_bg;
#endif
}
@@ -400,7 +400,7 @@ static void arc_init(void)
arc.body.padding.hor = 3;
arc.body.padding.ver = 3;
theme.arc = &arc;
theme.style.arc = &arc;
#endif
}
@@ -408,14 +408,14 @@ static void preload_init(void)
{
#if USE_LV_PRELOAD != 0
theme.preload = theme.arc;
theme.style.preload = theme.style.arc;
#endif
}
static void chart_init(void)
{
#if USE_LV_CHART
theme.chart = &panel;
theme.style.chart = &panel;
#endif
}
@@ -449,13 +449,13 @@ static void calendar_init(void)
lv_style_copy(&gray_text, &def);
gray_text.text.color = lv_color_hsv_to_rgb(_hue, 10, 65);
theme.calendar.bg = &panel;
theme.calendar.header = &header;
theme.calendar.week_box = &header;
theme.calendar.today_box = &today_box;
theme.calendar.day_names = &color_text;
theme.calendar.highlighted_days = &color_text;
theme.calendar.inactive_days = &gray_text;
theme.style.calendar.bg = &panel;
theme.style.calendar.header = &header;
theme.style.calendar.week_box = &header;
theme.style.calendar.today_box = &today_box;
theme.style.calendar.day_names = &color_text;
theme.style.calendar.highlighted_days = &color_text;
theme.style.calendar.inactive_days = &gray_text;
#endif
}
@@ -501,12 +501,12 @@ static void cb_init(void)
cb_ina.body.main_color = LV_COLOR_SILVER;
cb_ina.body.grad_color = LV_COLOR_SILVER;
theme.cb.bg = &cb_bg;
theme.cb.box.rel = &cb_rel;
theme.cb.box.pr = &cb_pr;
theme.cb.box.tgl_rel = &cb_trel;
theme.cb.box.tgl_pr = &cb_tpr;
theme.cb.box.ina = &cb_ina;
theme.style.cb.bg = &cb_bg;
theme.style.cb.box.rel = &cb_rel;
theme.style.cb.box.pr = &cb_pr;
theme.style.cb.box.tgl_rel = &cb_trel;
theme.style.cb.box.tgl_pr = &cb_tpr;
theme.style.cb.box.ina = &cb_ina;
#endif
}
@@ -540,24 +540,24 @@ static void btnm_init(void)
lv_style_copy(&btnm_ina, &btnm_rel);
btnm_ina.text.color = lv_color_hsv_to_rgb(_hue, 10, 60);
theme.btnm.bg = &btnm_bg;
theme.btnm.btn.rel = &btnm_rel;
theme.btnm.btn.pr = &btnm_pr;
theme.btnm.btn.tgl_rel = &btnm_trel;
theme.btnm.btn.tgl_pr = &btnm_pr;
theme.btnm.btn.ina = &btnm_ina;
theme.style.btnm.bg = &btnm_bg;
theme.style.btnm.btn.rel = &btnm_rel;
theme.style.btnm.btn.pr = &btnm_pr;
theme.style.btnm.btn.tgl_rel = &btnm_trel;
theme.style.btnm.btn.tgl_pr = &btnm_pr;
theme.style.btnm.btn.ina = &btnm_ina;
#endif
}
static void kb_init(void)
{
#if USE_LV_KB
theme.kb.bg = &btnm_bg;
theme.kb.btn.rel = &btnm_rel;
theme.kb.btn.pr = &btnm_pr;
theme.kb.btn.tgl_rel = &btnm_trel;
theme.kb.btn.tgl_pr = &btnm_pr;
theme.kb.btn.ina = &btnm_ina;
theme.style.kb.bg = &btnm_bg;
theme.style.kb.btn.rel = &btnm_rel;
theme.style.kb.btn.pr = &btnm_pr;
theme.style.kb.btn.tgl_rel = &btnm_trel;
theme.style.kb.btn.tgl_pr = &btnm_pr;
theme.style.kb.btn.ina = &btnm_ina;
#endif
}
@@ -569,38 +569,38 @@ static void mbox_init(void)
lv_style_copy(&mbox_bg, &panel);
mbox_bg.body.shadow.width = LV_DPI / 12;
theme.mbox.bg = &mbox_bg;
theme.mbox.btn.bg = &lv_style_transp;
theme.mbox.btn.rel = &btn_trel;
theme.mbox.btn.pr = &btn_tpr;
theme.style.mbox.bg = &mbox_bg;
theme.style.mbox.btn.bg = &lv_style_transp;
theme.style.mbox.btn.rel = &btn_trel;
theme.style.mbox.btn.pr = &btn_tpr;
#endif
}
static void page_init(void)
{
#if USE_LV_PAGE
theme.page.bg = &panel;
theme.page.scrl = &lv_style_transp_fit;
theme.page.sb = &sb;
theme.style.page.bg = &panel;
theme.style.page.scrl = &lv_style_transp_fit;
theme.style.page.sb = &sb;
#endif
}
static void ta_init(void)
{
#if USE_LV_TA
theme.ta.area = &panel;
theme.ta.oneline = &panel;
theme.ta.cursor = NULL;
theme.ta.sb = &sb;
theme.style.ta.area = &panel;
theme.style.ta.oneline = &panel;
theme.style.ta.cursor = NULL;
theme.style.ta.sb = &sb;
#endif
}
static void spinbox_init(void)
{
#if USE_LV_SPINBOX
theme.spinbox.bg= &panel;
theme.spinbox.cursor = theme.ta.cursor;
theme.spinbox.sb = theme.ta.sb;
theme.style.spinbox.bg= &panel;
theme.style.spinbox.cursor = theme.style.ta.cursor;
theme.style.spinbox.sb = theme.style.ta.sb;
#endif
}
@@ -631,14 +631,14 @@ static void list_init(void)
list_bg.body.padding.hor = 0;
list_bg.body.padding.ver = 0;
theme.list.sb = &sb;
theme.list.bg = &list_bg;
theme.list.scrl = &lv_style_transp_tight;
theme.list.btn.rel = &list_rel;
theme.list.btn.pr = &list_pr;
theme.list.btn.tgl_rel = &list_trel;
theme.list.btn.tgl_pr = &list_tpr;
theme.list.btn.ina = &list_ina;
theme.style.list.sb = &sb;
theme.style.list.bg = &list_bg;
theme.style.list.scrl = &lv_style_transp_tight;
theme.style.list.btn.rel = &list_rel;
theme.style.list.btn.pr = &list_pr;
theme.style.list.btn.tgl_rel = &list_trel;
theme.style.list.btn.tgl_pr = &list_tpr;
theme.style.list.btn.ina = &list_ina;
#endif
}
@@ -656,9 +656,9 @@ static void ddlist_init(void)
ddlist_sel.body.opa = LV_OPA_COVER;
ddlist_sel.body.radius = 0;
theme.ddlist.bg = &ddlist_bg;
theme.ddlist.sel = &ddlist_sel;
theme.ddlist.sb = &sb;
theme.style.ddlist.bg = &ddlist_bg;
theme.style.ddlist.sel = &ddlist_sel;
theme.style.ddlist.sb = &sb;
#endif
}
@@ -682,8 +682,8 @@ static void roller_init(void)
roller_sel.text.opa = LV_OPA_COVER;
roller_sel.text.color = lv_color_hsv_to_rgb(_hue, 70, 95);
theme.roller.bg = &roller_bg;
theme.roller.sel = &roller_sel;
theme.style.roller.bg = &roller_bg;
theme.style.roller.sel = &roller_sel;
#endif
}
@@ -736,22 +736,22 @@ static void tabview_init(void)
tab_indic.body.grad_color = lv_color_hsv_to_rgb(_hue, 80, 87);
tab_indic.body.padding.inner = LV_DPI / 10; /*Indicator height*/
theme.tabview.bg = &bg;
theme.tabview.indic = &tab_indic;
theme.tabview.btn.bg = &lv_style_transp_tight;
theme.tabview.btn.rel = &tab_rel;
theme.tabview.btn.pr = &tab_pr;
theme.tabview.btn.tgl_rel = &tab_trel;
theme.tabview.btn.tgl_pr = &tab_tpr;
theme.style.tabview.bg = &bg;
theme.style.tabview.indic = &tab_indic;
theme.style.tabview.btn.bg = &lv_style_transp_tight;
theme.style.tabview.btn.rel = &tab_rel;
theme.style.tabview.btn.pr = &tab_pr;
theme.style.tabview.btn.tgl_rel = &tab_trel;
theme.style.tabview.btn.tgl_pr = &tab_tpr;
#endif
}
static void tileview_init(void)
{
#if USE_LV_TILEVIEW != 0
theme.tileview.bg = &lv_style_transp_tight;
theme.tileview.scrl = &lv_style_transp_tight;
theme.tileview.sb = theme.page.sb;
theme.style.tileview.bg = &lv_style_transp_tight;
theme.style.tileview.scrl = &lv_style_transp_tight;
theme.style.tileview.sb = theme.style.page.sb;
#endif
}
@@ -766,8 +766,8 @@ static void table_init(void)
cell.body.padding.ver = LV_DPI / 12;
theme.table.bg = &lv_style_transp_tight;
theme.table.cell = &cell;
theme.style.table.bg = &lv_style_transp_tight;
theme.style.table.cell = &cell;
#endif
}
@@ -788,13 +788,13 @@ static void win_init(void)
header.body.border.part = LV_BORDER_BOTTOM;
header.text.color = lv_color_hsv_to_rgb(_hue, 5, 100);
theme.win.bg = &bg;
theme.win.sb = &sb;
theme.win.header = &header;
theme.win.content.bg = &lv_style_transp;
theme.win.content.scrl = &lv_style_transp;
theme.win.btn.rel = &btn_rel;
theme.win.btn.pr = &btn_pr;
theme.style.win.bg = &bg;
theme.style.win.sb = &sb;
theme.style.win.header = &header;
theme.style.win.content.bg = &lv_style_transp;
theme.style.win.content.scrl = &lv_style_transp;
theme.style.win.btn.rel = &btn_rel;
theme.style.win.btn.pr = &btn_pr;
#endif
}

View File

@@ -63,19 +63,19 @@ static void basic_init(void)
plain_bordered.body.border.width = 2;
plain_bordered.body.border.color = LV_COLOR_HEX3(0xbbb);
theme.bg = &lv_style_plain;
theme.panel = &lv_style_pretty;
theme.style.bg = &lv_style_plain;
theme.style.panel = &lv_style_pretty;
}
static void btn_init(void)
{
#if USE_LV_BTN != 0
theme.btn.rel = &lv_style_btn_rel;
theme.btn.pr = &lv_style_btn_pr;
theme.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.btn.ina = &lv_style_btn_ina;
theme.style.btn.rel = &lv_style_btn_rel;
theme.style.btn.pr = &lv_style_btn_pr;
theme.style.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.style.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.style.btn.ina = &lv_style_btn_ina;
#endif
}
@@ -92,9 +92,9 @@ static void label_init(void)
label_hint.text.color = LV_COLOR_HEX3(0xaaa);
theme.label.prim = &label_prim;
theme.label.sec = &label_sec;
theme.label.hint = &label_hint;
theme.style.label.prim = &label_prim;
theme.style.label.sec = &label_sec;
theme.style.label.hint = &label_hint;
#endif
}
@@ -104,8 +104,8 @@ static void img_init(void)
#if USE_LV_IMG != 0
theme.img.light = &def;
theme.img.dark = &def;
theme.style.img.light = &def;
theme.style.img.dark = &def;
#endif
}
@@ -113,7 +113,7 @@ static void line_init(void)
{
#if USE_LV_LINE != 0
theme.line.decor = &def;
theme.style.line.decor = &def;
#endif
}
@@ -130,7 +130,7 @@ static void led_init(void)
led.body.shadow.color = led.body.main_color;
theme.led = &led;
theme.style.led = &led;
#endif
}
@@ -138,8 +138,8 @@ static void bar_init(void)
{
#if USE_LV_BAR
theme.bar.bg = &lv_style_pretty;
theme.bar.indic = &lv_style_pretty_color;
theme.style.bar.bg = &lv_style_pretty;
theme.style.bar.indic = &lv_style_pretty_color;
#endif
}
@@ -150,9 +150,9 @@ static void slider_init(void)
slider_bg.body.padding.hor = LV_DPI / 20;
slider_bg.body.padding.ver = LV_DPI / 20;
theme.slider.bg = &slider_bg;
theme.slider.indic = &lv_style_pretty_color;
theme.slider.knob = &lv_style_pretty;
theme.style.slider.bg = &slider_bg;
theme.style.slider.indic = &lv_style_pretty_color;
theme.style.slider.knob = &lv_style_pretty;
#endif
}
@@ -163,10 +163,10 @@ static void sw_init(void)
sw_bg.body.padding.hor = 3;
sw_bg.body.padding.ver = 3;
theme.sw.bg = &sw_bg;
theme.sw.indic = &lv_style_pretty_color;
theme.sw.knob_off = &lv_style_pretty;
theme.sw.knob_on = &lv_style_pretty;
theme.style.sw.bg = &sw_bg;
theme.style.sw.indic = &lv_style_pretty_color;
theme.style.sw.knob_off = &lv_style_pretty;
theme.style.sw.knob_on = &lv_style_pretty;
#endif
}
@@ -181,7 +181,7 @@ static void lmeter_init(void)
lmeter.body.main_color = lv_color_mix(lmeter.body.main_color, LV_COLOR_WHITE, LV_OPA_50);
lmeter.body.grad_color = lv_color_mix(lmeter.body.grad_color, LV_COLOR_BLACK, LV_OPA_50);
theme.lmeter = &lmeter;
theme.style.lmeter = &lmeter;
#endif
}
@@ -196,7 +196,7 @@ static void gauge_init(void)
gauge.body.grad_color = lmeter.body.main_color;
gauge.text.color = LV_COLOR_HEX3(0x888);
theme.gauge = &gauge;
theme.style.gauge = &gauge;
#endif
}
@@ -205,7 +205,7 @@ static void chart_init(void)
#if USE_LV_CHART
theme.chart = &lv_style_pretty;
theme.style.chart = &lv_style_pretty;
#endif
}
@@ -214,12 +214,12 @@ static void cb_init(void)
#if USE_LV_CB != 0
theme.cb.bg = &lv_style_transp;
theme.cb.box.rel = &lv_style_pretty;
theme.cb.box.pr = &lv_style_btn_pr;
theme.cb.box.tgl_rel = &lv_style_btn_tgl_rel;
theme.cb.box.tgl_pr = &lv_style_btn_tgl_pr;
theme.cb.box.ina = &lv_style_btn_ina;
theme.style.cb.bg = &lv_style_transp;
theme.style.cb.box.rel = &lv_style_pretty;
theme.style.cb.box.pr = &lv_style_btn_pr;
theme.style.cb.box.tgl_rel = &lv_style_btn_tgl_rel;
theme.style.cb.box.tgl_pr = &lv_style_btn_tgl_pr;
theme.style.cb.box.ina = &lv_style_btn_ina;
#endif
}
@@ -229,12 +229,12 @@ static void btnm_init(void)
#if USE_LV_BTNM
theme.btnm.bg = &lv_style_pretty;
theme.btnm.btn.rel = &lv_style_btn_rel;
theme.btnm.btn.pr = &lv_style_btn_pr;
theme.btnm.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.btnm.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.btnm.btn.ina = &lv_style_btn_ina;
theme.style.btnm.bg = &lv_style_pretty;
theme.style.btnm.btn.rel = &lv_style_btn_rel;
theme.style.btnm.btn.pr = &lv_style_btn_pr;
theme.style.btnm.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.style.btnm.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.style.btnm.btn.ina = &lv_style_btn_ina;
#endif
}
@@ -243,12 +243,12 @@ static void kb_init(void)
#if USE_LV_KB
theme.kb.bg = &lv_style_pretty;
theme.kb.btn.rel = &lv_style_btn_rel;
theme.kb.btn.pr = &lv_style_btn_pr;
theme.kb.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.kb.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.kb.btn.ina = &lv_style_btn_ina;
theme.style.kb.bg = &lv_style_pretty;
theme.style.kb.btn.rel = &lv_style_btn_rel;
theme.style.kb.btn.pr = &lv_style_btn_pr;
theme.style.kb.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.style.kb.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.style.kb.btn.ina = &lv_style_btn_ina;
#endif
}
@@ -258,10 +258,10 @@ static void mbox_init(void)
#if USE_LV_MBOX
theme.mbox.bg = &lv_style_pretty;
theme.mbox.btn.bg = &lv_style_transp;
theme.mbox.btn.rel = &lv_style_btn_rel;
theme.mbox.btn.pr = &lv_style_btn_tgl_pr;
theme.style.mbox.bg = &lv_style_pretty;
theme.style.mbox.btn.bg = &lv_style_transp;
theme.style.mbox.btn.rel = &lv_style_btn_rel;
theme.style.mbox.btn.pr = &lv_style_btn_tgl_pr;
#endif
}
@@ -270,9 +270,9 @@ static void page_init(void)
#if USE_LV_PAGE
theme.page.bg = &lv_style_pretty;
theme.page.scrl = &lv_style_transp_tight;
theme.page.sb = &sb;
theme.style.page.bg = &lv_style_pretty;
theme.style.page.scrl = &lv_style_transp_tight;
theme.style.page.sb = &sb;
#endif
}
@@ -281,10 +281,10 @@ static void ta_init(void)
#if USE_LV_TA
theme.ta.area = &lv_style_pretty;
theme.ta.oneline = &lv_style_pretty;
theme.ta.cursor = NULL;
theme.ta.sb = &sb;
theme.style.ta.area = &lv_style_pretty;
theme.style.ta.oneline = &lv_style_pretty;
theme.style.ta.cursor = NULL;
theme.style.ta.sb = &sb;
#endif
}
@@ -292,14 +292,14 @@ static void list_init(void)
{
#if USE_LV_LIST != 0
theme.list.bg = &lv_style_pretty;
theme.list.scrl = &lv_style_transp_fit;
theme.list.sb = &sb;
theme.list.btn.rel = &lv_style_btn_rel;
theme.list.btn.pr = &lv_style_btn_pr;
theme.list.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.list.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.list.btn.ina = &lv_style_btn_ina;
theme.style.list.bg = &lv_style_pretty;
theme.style.list.scrl = &lv_style_transp_fit;
theme.style.list.sb = &sb;
theme.style.list.btn.rel = &lv_style_btn_rel;
theme.style.list.btn.pr = &lv_style_btn_pr;
theme.style.list.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.style.list.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.style.list.btn.ina = &lv_style_btn_ina;
#endif
}
@@ -308,9 +308,9 @@ static void ddlist_init(void)
#if USE_LV_DDLIST != 0
theme.ddlist.bg = &lv_style_pretty;
theme.ddlist.sel = &lv_style_plain_color;
theme.ddlist.sb = &sb;
theme.style.ddlist.bg = &lv_style_pretty;
theme.style.ddlist.sel = &lv_style_plain_color;
theme.style.ddlist.sb = &sb;
#endif
}
@@ -319,8 +319,8 @@ static void roller_init(void)
#if USE_LV_ROLLER != 0
theme.roller.bg = &lv_style_pretty;
theme.roller.sel = &lv_style_plain_color;
theme.style.roller.bg = &lv_style_pretty;
theme.style.roller.sel = &lv_style_plain_color;
#endif
}
@@ -329,13 +329,13 @@ static void tabview_init(void)
#if USE_LV_TABVIEW != 0
theme.tabview.bg = &plain_bordered;
theme.tabview.indic = &lv_style_plain_color;
theme.tabview.btn.bg = &lv_style_transp;
theme.tabview.btn.rel = &lv_style_btn_rel;
theme.tabview.btn.pr = &lv_style_btn_pr;
theme.tabview.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.tabview.btn.tgl_pr = &lv_style_btn_tgl_pr;
theme.style.tabview.bg = &plain_bordered;
theme.style.tabview.indic = &lv_style_plain_color;
theme.style.tabview.btn.bg = &lv_style_transp;
theme.style.tabview.btn.rel = &lv_style_btn_rel;
theme.style.tabview.btn.pr = &lv_style_btn_pr;
theme.style.tabview.btn.tgl_rel = &lv_style_btn_tgl_rel;
theme.style.tabview.btn.tgl_pr = &lv_style_btn_tgl_pr;
#endif
}
@@ -345,13 +345,13 @@ static void win_init(void)
#if USE_LV_WIN != 0
theme.win.bg = &plain_bordered;
theme.win.sb = &sb;
theme.win.header = &lv_style_plain_color;
theme.win.content.bg = &lv_style_transp;
theme.win.content.scrl = &lv_style_transp;
theme.win.btn.rel = &lv_style_btn_rel;
theme.win.btn.pr = &lv_style_btn_pr;
theme.style.win.bg = &plain_bordered;
theme.style.win.sb = &sb;
theme.style.win.header = &lv_style_plain_color;
theme.style.win.content.bg = &lv_style_transp;
theme.style.win.content.scrl = &lv_style_transp;
theme.style.win.btn.rel = &lv_style_btn_rel;
theme.style.win.btn.pr = &lv_style_btn_pr;
#endif
}

View File

@@ -79,8 +79,8 @@ static void basic_init(void)
sb.body.opa = LV_OPA_40;
sb.body.padding.hor = LV_DPI / 25;
theme.bg = &bg;
theme.panel = &panel;
theme.style.bg = &bg;
theme.style.panel = &panel;
}
@@ -89,7 +89,7 @@ static void cont_init(void)
#if USE_LV_CONT != 0
theme.cont = theme.panel;
theme.style.cont = theme.style.panel;
#endif
}
@@ -132,11 +132,11 @@ static void btn_init(void)
ina.body.shadow.width = 0;
ina.text.color = lv_color_hsv_to_rgb(_hue, 95, 5);
theme.btn.rel = &rel;
theme.btn.pr = &pr;
theme.btn.tgl_rel = &tgl_rel;
theme.btn.tgl_pr = &tgl_pr;
theme.btn.ina = &ina;
theme.style.btn.rel = &rel;
theme.style.btn.pr = &pr;
theme.style.btn.tgl_rel = &tgl_rel;
theme.style.btn.tgl_pr = &tgl_pr;
theme.style.btn.ina = &ina;
#endif
}
@@ -156,9 +156,9 @@ static void label_init(void)
lv_style_copy(&hint, &prim);
hint.text.color = lv_color_hsv_to_rgb(_hue, 40, 90);
theme.label.prim = &prim;
theme.label.sec = &sec;
theme.label.hint = &hint;
theme.style.label.prim = &prim;
theme.style.label.sec = &sec;
theme.style.label.hint = &hint;
#endif
}
@@ -175,8 +175,8 @@ static void img_init(void)
img_light.image.intense = LV_OPA_80;
theme.img.light = &def;
theme.img.dark = &def;
theme.style.img.light = &def;
theme.style.img.dark = &def;
#endif
}
@@ -185,7 +185,7 @@ static void line_init(void)
#if USE_LV_LINE != 0
theme.line.decor = &def;
theme.style.line.decor = &def;
#endif
}
@@ -204,7 +204,7 @@ static void led_init(void)
led.body.shadow.color = lv_color_hsv_to_rgb(_hue, 100, 100);
theme.led = &led;
theme.style.led = &led;
#endif
}
@@ -227,8 +227,8 @@ static void bar_init(void)
bar_indic.body.padding.hor = 0;
bar_indic.body.padding.ver = 0;
theme.bar.bg = &bar_bg;
theme.bar.indic = &bar_indic;
theme.style.bar.bg = &bar_bg;
theme.style.bar.indic = &bar_indic;
#endif
}
@@ -240,12 +240,12 @@ static void slider_init(void)
lv_style_copy(&knob, &def);
knob.body.radius = LV_RADIUS_CIRCLE;
knob.body.border.width = 0;
knob.body.main_color = theme.bar.indic->body.main_color;
knob.body.main_color = theme.style.bar.indic->body.main_color;
knob.body.grad_color = knob.body.main_color;
theme.slider.bg = theme.bar.bg;
theme.slider.indic = theme.bar.indic;
theme.slider.knob = &knob;
theme.style.slider.bg = theme.style.bar.bg;
theme.style.slider.indic = theme.style.bar.indic;
theme.style.slider.knob = &knob;
#endif
}
@@ -253,13 +253,13 @@ static void sw_init(void)
{
#if USE_LV_SW != 0
static lv_style_t sw_bg, sw_indic, sw_knob_off, sw_knob_on;
lv_style_copy(&sw_bg, theme.slider.bg);
lv_style_copy(&sw_bg, theme.style.slider.bg);
sw_bg.body.radius = LV_RADIUS_CIRCLE;
lv_style_copy(&sw_indic, theme.slider.bg);
lv_style_copy(&sw_indic, theme.style.slider.bg);
sw_indic.body.radius = LV_RADIUS_CIRCLE;
lv_style_copy(&sw_knob_on, theme.slider.knob);
lv_style_copy(&sw_knob_on, theme.style.slider.knob);
sw_knob_on.body.shadow.width = 3;
sw_knob_on.body.shadow.type = LV_SHADOW_BOTTOM;
sw_knob_on.body.shadow.color = DEF_SHADOW_COLOR;
@@ -272,10 +272,10 @@ static void sw_init(void)
sw_knob_off.body.border.color = LV_COLOR_HEX3(0x999);
sw_knob_off.body.border.opa = LV_OPA_COVER;
theme.sw.bg = &sw_bg;
theme.sw.indic = &sw_indic;
theme.sw.knob_off = &sw_knob_off;
theme.sw.knob_on = &sw_knob_on;
theme.style.sw.bg = &sw_bg;
theme.style.sw.indic = &sw_indic;
theme.style.sw.knob_off = &sw_knob_off;
theme.style.sw.knob_on = &sw_knob_on;
#endif
}
@@ -291,7 +291,7 @@ static void lmeter_init(void)
lmeter.line.color = LV_COLOR_HEX3(0x999);
lmeter.line.width = 2;
theme.lmeter = &lmeter;
theme.style.lmeter = &lmeter;
#endif
}
@@ -310,7 +310,7 @@ static void gauge_init(void)
gauge.line.width = 3;
gauge.line.color = lv_color_hsv_to_rgb(_hue, 95, 70);
theme.gauge = &gauge;
theme.style.gauge = &gauge;
#endif
}
@@ -329,7 +329,7 @@ static void arc_init(void)
arc.body.padding.hor = 0;
arc.body.padding.ver = 0;
theme.arc = &arc;
theme.style.arc = &arc;
#endif
}
@@ -337,14 +337,14 @@ static void preload_init(void)
{
#if USE_LV_PRELOAD != 0
theme.preload = theme.arc;
theme.style.preload = theme.style.arc;
#endif
}
static void chart_init(void)
{
#if USE_LV_CHART
theme.chart = theme.panel;
theme.style.chart = theme.style.panel;
#endif
}
@@ -364,9 +364,9 @@ static void calendar_init(void)
week_box.body.main_color = lv_color_hsv_to_rgb(_hue, 40, 100);
week_box.body.grad_color = lv_color_hsv_to_rgb(_hue, 40, 100);
week_box.body.padding.ver = LV_DPI / 20;
week_box.body.padding.hor = theme.panel->body.padding.hor;
week_box.body.border.color = theme.panel->body.border.color;
week_box.body.border.width = theme.panel->body.border.width;
week_box.body.padding.hor = theme.style.panel->body.padding.hor;
week_box.body.border.color = theme.style.panel->body.border.color;
week_box.body.border.width = theme.style.panel->body.border.width;
week_box.body.border.part = LV_BORDER_LEFT | LV_BORDER_RIGHT;
week_box.body.radius = 0;
@@ -377,12 +377,12 @@ static void calendar_init(void)
today_box.body.padding.ver = LV_DPI / 20;
today_box.body.radius = 0;
theme.calendar.bg = theme.panel;
theme.calendar.header = &lv_style_transp;
theme.calendar.inactive_days = &ina_days;
theme.calendar.highlighted_days = &high_days;
theme.calendar.week_box = &week_box;
theme.calendar.today_box = &today_box;
theme.style.calendar.bg = theme.style.panel;
theme.style.calendar.header = &lv_style_transp;
theme.style.calendar.inactive_days = &ina_days;
theme.style.calendar.highlighted_days = &high_days;
theme.style.calendar.week_box = &week_box;
theme.style.calendar.today_box = &today_box;
#endif
}
@@ -390,7 +390,7 @@ static void cb_init(void)
{
#if USE_LV_CB != 0
static lv_style_t rel, pr, tgl_rel, tgl_pr, ina;
lv_style_copy(&rel, theme.panel);
lv_style_copy(&rel, theme.style.panel);
rel.body.shadow.type = LV_SHADOW_BOTTOM;
rel.body.shadow.width = 3;
@@ -410,14 +410,14 @@ static void cb_init(void)
tgl_pr.body.grad_color = tgl_pr.body.main_color;
tgl_pr.body.shadow.width = 0;
lv_style_copy(&ina, theme.btn.ina);
lv_style_copy(&ina, theme.style.btn.ina);
theme.cb.bg = &lv_style_transp;
theme.cb.box.rel = &rel;
theme.cb.box.pr = &pr;
theme.cb.box.tgl_rel = &tgl_rel;
theme.cb.box.tgl_pr = &tgl_pr;
theme.cb.box.ina = &ina;
theme.style.cb.bg = &lv_style_transp;
theme.style.cb.box.rel = &rel;
theme.style.cb.box.pr = &pr;
theme.style.cb.box.tgl_rel = &tgl_rel;
theme.style.cb.box.tgl_pr = &tgl_pr;
theme.style.cb.box.ina = &ina;
#endif
}
@@ -427,13 +427,13 @@ static void btnm_init(void)
#if USE_LV_BTNM
static lv_style_t bg, rel, pr, tgl_rel, tgl_pr, ina;
lv_style_copy(&bg, theme.panel);
lv_style_copy(&bg, theme.style.panel);
bg.body.padding.hor = 0;
bg.body.padding.ver = 0;
bg.body.padding.inner = 0;
bg.text.color = LV_COLOR_HEX3(0x555);
lv_style_copy(&rel, theme.panel);
lv_style_copy(&rel, theme.style.panel);
rel.body.border.part = LV_BORDER_FULL | LV_BORDER_INTERNAL;
rel.body.border.width = 1;
rel.body.border.color = LV_COLOR_HEX3(0xbbb);
@@ -462,12 +462,12 @@ static void btnm_init(void)
ina.body.main_color = LV_COLOR_HEX3(0xccc);
ina.body.grad_color = ina.body.main_color;
theme.btnm.bg = &bg;
theme.btnm.btn.rel = &rel;
theme.btnm.btn.pr = &pr;
theme.btnm.btn.tgl_rel = &tgl_rel;
theme.btnm.btn.tgl_pr = &tgl_pr;
theme.btnm.btn.ina = &def;
theme.style.btnm.bg = &bg;
theme.style.btnm.btn.rel = &rel;
theme.style.btnm.btn.pr = &pr;
theme.style.btnm.btn.tgl_rel = &tgl_rel;
theme.style.btnm.btn.tgl_pr = &tgl_pr;
theme.style.btnm.btn.ina = &def;
#endif
}
@@ -479,12 +479,12 @@ static void kb_init(void)
lv_style_copy(&rel, &lv_style_transp);
rel.text.font = _font;
theme.kb.bg = theme.btnm.bg;
theme.kb.btn.rel = &rel;
theme.kb.btn.pr = theme.btnm.btn.pr;
theme.kb.btn.tgl_rel = theme.btnm.btn.tgl_rel;
theme.kb.btn.tgl_pr = theme.btnm.btn.tgl_pr;
theme.kb.btn.ina = theme.btnm.btn.ina;
theme.style.kb.bg = theme.style.btnm.bg;
theme.style.kb.btn.rel = &rel;
theme.style.kb.btn.pr = theme.style.btnm.btn.pr;
theme.style.kb.btn.tgl_rel = theme.style.btnm.btn.tgl_rel;
theme.style.kb.btn.tgl_pr = theme.style.btnm.btn.tgl_pr;
theme.style.kb.btn.ina = theme.style.btnm.btn.ina;
#endif
}
@@ -499,13 +499,13 @@ static void mbox_init(void)
rel.text.font = _font;
rel.text.color = lv_color_hsv_to_rgb(_hue, 85, 75);
lv_style_copy(&pr, theme.btnm.btn.pr);
lv_style_copy(&pr, theme.style.btnm.btn.pr);
pr.text.color = lv_color_hsv_to_rgb(_hue, 85, 60);
theme.mbox.bg = theme.panel;
theme.mbox.btn.bg = &lv_style_transp;
theme.mbox.btn.rel = &rel;
theme.mbox.btn.pr = &pr;
theme.style.mbox.bg = theme.style.panel;
theme.style.mbox.btn.bg = &lv_style_transp;
theme.style.mbox.btn.rel = &rel;
theme.style.mbox.btn.pr = &pr;
#endif
}
@@ -514,9 +514,9 @@ static void page_init(void)
#if USE_LV_PAGE
theme.page.bg = theme.panel;
theme.page.scrl = &lv_style_transp;
theme.page.sb = &sb;
theme.style.page.bg = theme.style.panel;
theme.style.page.scrl = &lv_style_transp;
theme.style.page.sb = &sb;
#endif
}
@@ -534,19 +534,19 @@ static void ta_init(void)
oneline.body.border.opa = LV_OPA_COVER;
oneline.text.color = LV_COLOR_HEX3(0x333);
theme.ta.area = theme.panel;
theme.ta.oneline = &oneline;
theme.ta.cursor = NULL; /*Let library to calculate the cursor's style*/
theme.ta.sb = &sb;
theme.style.ta.area = theme.style.panel;
theme.style.ta.oneline = &oneline;
theme.style.ta.cursor = NULL; /*Let library to calculate the cursor's style*/
theme.style.ta.sb = &sb;
#endif
}
static void spinbox_init(void)
{
#if USE_LV_SPINBOX
theme.spinbox.bg= theme.panel;
theme.spinbox.cursor = theme.ta.cursor;
theme.spinbox.sb = theme.ta.sb;
theme.style.spinbox.bg= theme.style.panel;
theme.style.spinbox.cursor = theme.style.ta.cursor;
theme.style.spinbox.sb = theme.style.ta.sb;
#endif
}
@@ -556,7 +556,7 @@ static void list_init(void)
static lv_style_t list_bg, rel, pr, tgl_rel, tgl_pr, ina;
lv_style_copy(&list_bg, theme.panel);
lv_style_copy(&list_bg, theme.style.panel);
list_bg.body.padding.hor = 0;
list_bg.body.padding.ver = 0;
list_bg.body.padding.inner = 0;
@@ -594,14 +594,14 @@ static void list_init(void)
ina.body.grad_color = ina.body.main_color;
theme.list.sb = &sb;
theme.list.bg = &list_bg;
theme.list.scrl = &lv_style_transp_tight;
theme.list.btn.rel = &rel;
theme.list.btn.pr = &pr;
theme.list.btn.tgl_rel = &tgl_rel;
theme.list.btn.tgl_pr = &tgl_pr;
theme.list.btn.ina = &ina;
theme.style.list.sb = &sb;
theme.style.list.bg = &list_bg;
theme.style.list.scrl = &lv_style_transp_tight;
theme.style.list.btn.rel = &rel;
theme.style.list.btn.pr = &pr;
theme.style.list.btn.tgl_rel = &tgl_rel;
theme.style.list.btn.tgl_pr = &tgl_pr;
theme.style.list.btn.ina = &ina;
#endif
}
@@ -609,7 +609,7 @@ static void ddlist_init(void)
{
#if USE_LV_DDLIST != 0
static lv_style_t bg, sel;
lv_style_copy(&bg, theme.panel);
lv_style_copy(&bg, theme.style.panel);
bg.body.padding.hor = LV_DPI / 6;
bg.body.padding.ver = LV_DPI / 6;
bg.text.line_space = LV_DPI / 8;
@@ -623,9 +623,9 @@ static void ddlist_init(void)
sel.text.color = lv_color_hsv_to_rgb(_hue, 5, 95);
theme.ddlist.bg = &bg;
theme.ddlist.sel = &sel;
theme.ddlist.sb = &sb;
theme.style.ddlist.bg = &bg;
theme.style.ddlist.sel = &sel;
theme.style.ddlist.sb = &sb;
#endif
}
@@ -645,8 +645,8 @@ static void roller_init(void)
roller_sel.text.color = lv_color_hsv_to_rgb(_hue, 90, 70);
theme.roller.bg = &roller_bg;
theme.roller.sel = &roller_sel;
theme.style.roller.bg = &roller_bg;
theme.style.roller.sel = &roller_sel;
#endif
}
@@ -708,22 +708,22 @@ static void tabview_init(void)
tgl_pr.body.radius = 0;
tgl_pr.text.color = lv_color_hsv_to_rgb(_hue, 90, 60);
theme.tabview.bg = theme.bg;
theme.tabview.indic = &indic;
theme.tabview.btn.bg = &btn_bg;
theme.tabview.btn.rel = &rel;
theme.tabview.btn.pr = &pr;
theme.tabview.btn.tgl_rel = &tgl_rel;
theme.tabview.btn.tgl_pr = &tgl_pr;
theme.style.tabview.bg = theme.style.bg;
theme.style.tabview.indic = &indic;
theme.style.tabview.btn.bg = &btn_bg;
theme.style.tabview.btn.rel = &rel;
theme.style.tabview.btn.pr = &pr;
theme.style.tabview.btn.tgl_rel = &tgl_rel;
theme.style.tabview.btn.tgl_pr = &tgl_pr;
#endif
}
static void tileview_init(void)
{
#if USE_LV_TILEVIEW != 0
theme.tileview.bg = &lv_style_transp_tight;
theme.tileview.scrl = &lv_style_transp_tight;
theme.tileview.sb = theme.page.sb;
theme.style.tileview.bg = &lv_style_transp_tight;
theme.style.tileview.scrl = &lv_style_transp_tight;
theme.style.tileview.sb = theme.style.page.sb;
#endif
}
@@ -731,15 +731,15 @@ static void table_init(void)
{
#if USE_LV_TABLE != 0
static lv_style_t cell;
lv_style_copy(&cell, theme.panel);
lv_style_copy(&cell, theme.style.panel);
cell.body.radius = 0;
cell.body.border.width = 1;
cell.body.padding.hor = LV_DPI / 12;
cell.body.padding.ver = LV_DPI / 12;
theme.table.bg = &lv_style_transp_tight;
theme.table.cell = &cell;
theme.style.table.bg = &lv_style_transp_tight;
theme.style.table.cell = &cell;
#endif
}
@@ -770,13 +770,13 @@ static void win_init(void)
pr.text.color = LV_COLOR_HEX3(0x111);
theme.win.bg = theme.panel;
theme.win.sb = &sb;
theme.win.header = &header;
theme.win.content.bg = &lv_style_transp;
theme.win.content.scrl = &lv_style_transp;
theme.win.btn.rel = &lv_style_transp;
theme.win.btn.pr = &pr;
theme.style.win.bg = theme.style.panel;
theme.style.win.sb = &sb;
theme.style.win.header = &header;
theme.style.win.content.bg = &lv_style_transp;
theme.style.win.content.scrl = &lv_style_transp;
theme.style.win.btn.rel = &lv_style_transp;
theme.style.win.btn.pr = &pr;
#endif
}

View File

@@ -91,8 +91,8 @@ static void basic_init(void)
lv_style_copy(&dark_frame, &dark_plain);
dark_frame.body.radius = LV_DPI / 20;
theme.bg = &def;
theme.panel = &light_frame;
theme.style.bg = &def;
theme.style.panel = &light_frame;
}
@@ -101,7 +101,7 @@ static void cont_init(void)
#if USE_LV_CONT != 0
theme.cont = &def;
theme.style.cont = &def;
#endif
}
@@ -110,11 +110,11 @@ static void btn_init(void)
#if USE_LV_BTN != 0
theme.btn.rel = &light_frame;
theme.btn.pr = &dark_frame;
theme.btn.tgl_rel = &dark_frame;
theme.btn.tgl_pr = &light_frame;
theme.btn.ina = &light_frame;
theme.style.btn.rel = &light_frame;
theme.style.btn.pr = &dark_frame;
theme.style.btn.tgl_rel = &dark_frame;
theme.style.btn.tgl_pr = &light_frame;
theme.style.btn.ina = &light_frame;
#endif
}
@@ -124,9 +124,9 @@ static void label_init(void)
#if USE_LV_LABEL != 0
theme.label.prim = NULL;
theme.label.sec = NULL;
theme.label.hint = NULL;
theme.style.label.prim = NULL;
theme.style.label.sec = NULL;
theme.style.label.hint = NULL;
#endif
}
@@ -135,15 +135,15 @@ static void img_init(void)
#if USE_LV_IMG != 0
theme.img.light = &def;
theme.img.dark = &def;
theme.style.img.light = &def;
theme.style.img.dark = &def;
#endif
}
static void line_init(void)
{
#if USE_LV_LINE != 0
theme.line.decor = NULL;
theme.style.line.decor = NULL;
#endif
}
@@ -157,7 +157,7 @@ static void led_init(void)
led.body.shadow.color = LV_COLOR_BLACK;
led.body.shadow.type = LV_SHADOW_FULL;
theme.led = &led;
theme.style.led = &led;
#endif
}
@@ -177,8 +177,8 @@ static void bar_init(void)
bar_indic.body.padding.ver = LV_DPI / 30;
bar_indic.body.radius = LV_RADIUS_CIRCLE;
theme.bar.bg = &bar_bg;
theme.bar.indic = &bar_indic;
theme.style.bar.bg = &bar_bg;
theme.style.bar.indic = &bar_indic;
#endif
}
@@ -191,9 +191,9 @@ static void slider_init(void)
slider_knob.body.padding.hor = LV_DPI / 30;
slider_knob.body.padding.ver = LV_DPI / 30;
theme.slider.bg = theme.bar.bg;
theme.slider.indic = theme.bar.indic;
theme.slider.knob = &slider_knob;
theme.style.slider.bg = theme.style.bar.bg;
theme.style.slider.indic = theme.style.bar.indic;
theme.style.slider.knob = &slider_knob;
#endif
}
@@ -202,10 +202,10 @@ static void sw_init(void)
#if USE_LV_SW != 0
theme.sw.bg = theme.slider.bg;
theme.sw.indic = theme.slider.indic;
theme.sw.knob_off = theme.slider.knob;
theme.sw.knob_on = theme.slider.knob;
theme.style.sw.bg = theme.style.slider.bg;
theme.style.sw.indic = theme.style.slider.indic;
theme.style.sw.knob_off = theme.style.slider.knob;
theme.style.sw.knob_on = theme.style.slider.knob;
#endif
}
@@ -223,7 +223,7 @@ static void lmeter_init(void)
lmeter_bg.line.color = LV_COLOR_WHITE;
lmeter_bg.line.width = 1;
theme.lmeter = &lmeter_bg;
theme.style.lmeter = &lmeter_bg;
#endif
}
@@ -231,19 +231,19 @@ static void gauge_init(void)
{
#if USE_LV_GAUGE != 0
static lv_style_t gauge_bg;
lv_style_copy(&gauge_bg, theme.lmeter);
lv_style_copy(&gauge_bg, theme.style.lmeter);
gauge_bg.line.color = LV_COLOR_BLACK;
gauge_bg.line.width = 1;
theme.gauge = &gauge_bg;
theme.style.gauge = &gauge_bg;
#endif
}
static void chart_init(void)
{
#if USE_LV_CHART
theme.chart = &light_frame;
theme.style.chart = &light_frame;
#endif
}
@@ -255,8 +255,8 @@ static void calendar_init(void)
box.body.padding.ver = LV_DPI / 20;
/*Can't handle highlighted dates in this theme*/
theme.calendar.week_box = &box;
theme.calendar.today_box = &box;
theme.style.calendar.week_box = &box;
theme.style.calendar.today_box = &box;
#endif
}
@@ -265,12 +265,12 @@ static void cb_init(void)
#if USE_LV_CB != 0
theme.cb.bg = &lv_style_transp;
theme.cb.box.rel = &light_frame;
theme.cb.box.pr = &dark_frame;
theme.cb.box.tgl_rel = &dark_frame;
theme.cb.box.tgl_pr = &light_frame;
theme.cb.box.ina = &light_frame;
theme.style.cb.bg = &lv_style_transp;
theme.style.cb.box.rel = &light_frame;
theme.style.cb.box.pr = &dark_frame;
theme.style.cb.box.tgl_rel = &dark_frame;
theme.style.cb.box.tgl_pr = &light_frame;
theme.style.cb.box.ina = &light_frame;
#endif
}
@@ -280,24 +280,24 @@ static void btnm_init(void)
#if USE_LV_BTNM
theme.btnm.bg = &light_frame;
theme.btnm.btn.rel = &light_frame;
theme.btnm.btn.pr = &dark_frame;
theme.btnm.btn.tgl_rel = &dark_frame;
theme.btnm.btn.tgl_pr = &light_frame;
theme.btnm.btn.ina = &light_frame;
theme.style.btnm.bg = &light_frame;
theme.style.btnm.btn.rel = &light_frame;
theme.style.btnm.btn.pr = &dark_frame;
theme.style.btnm.btn.tgl_rel = &dark_frame;
theme.style.btnm.btn.tgl_pr = &light_frame;
theme.style.btnm.btn.ina = &light_frame;
#endif
}
static void kb_init(void)
{
#if USE_LV_KB
theme.kb.bg = &lv_style_transp_fit;
theme.kb.btn.rel = &light_frame;
theme.kb.btn.pr = &light_frame;
theme.kb.btn.tgl_rel = &dark_frame;
theme.kb.btn.tgl_pr = &dark_frame;
theme.kb.btn.ina = &light_frame;
theme.style.kb.bg = &lv_style_transp_fit;
theme.style.kb.btn.rel = &light_frame;
theme.style.kb.btn.pr = &light_frame;
theme.style.kb.btn.tgl_rel = &dark_frame;
theme.style.kb.btn.tgl_pr = &dark_frame;
theme.style.kb.btn.ina = &light_frame;
#endif
}
@@ -307,10 +307,10 @@ static void mbox_init(void)
#if USE_LV_MBOX
theme.mbox.bg = &dark_frame;
theme.mbox.btn.bg = &lv_style_transp_fit;
theme.mbox.btn.rel = &light_frame;
theme.mbox.btn.pr = &dark_frame;
theme.style.mbox.bg = &dark_frame;
theme.style.mbox.btn.bg = &lv_style_transp_fit;
theme.style.mbox.btn.rel = &light_frame;
theme.style.mbox.btn.pr = &dark_frame;
#endif
}
@@ -319,9 +319,9 @@ static void page_init(void)
#if USE_LV_PAGE
theme.page.bg = &light_frame;
theme.page.scrl = &light_frame;
theme.page.sb = &dark_frame;
theme.style.page.bg = &light_frame;
theme.style.page.scrl = &light_frame;
theme.style.page.sb = &dark_frame;
#endif
}
@@ -330,10 +330,10 @@ static void ta_init(void)
#if USE_LV_TA
theme.ta.area = &light_frame;
theme.ta.oneline = &light_frame;
theme.ta.cursor = NULL; /*Let library to calculate the cursor's style*/
theme.ta.sb = &dark_frame;
theme.style.ta.area = &light_frame;
theme.style.ta.oneline = &light_frame;
theme.style.ta.cursor = NULL; /*Let library to calculate the cursor's style*/
theme.style.ta.sb = &dark_frame;
#endif
}
@@ -342,14 +342,14 @@ static void list_init(void)
#if USE_LV_LIST != 0
theme.list.sb = &dark_frame;
theme.list.bg = &light_frame;
theme.list.scrl = &lv_style_transp_fit;
theme.list.btn.rel = &light_plain;
theme.list.btn.pr = &dark_plain;
theme.list.btn.tgl_rel = &dark_plain;
theme.list.btn.tgl_pr = &light_plain;
theme.list.btn.ina = &light_plain;
theme.style.list.sb = &dark_frame;
theme.style.list.bg = &light_frame;
theme.style.list.scrl = &lv_style_transp_fit;
theme.style.list.btn.rel = &light_plain;
theme.style.list.btn.pr = &dark_plain;
theme.style.list.btn.tgl_rel = &dark_plain;
theme.style.list.btn.tgl_pr = &light_plain;
theme.style.list.btn.ina = &light_plain;
#endif
}
@@ -360,9 +360,9 @@ static void ddlist_init(void)
lv_style_copy(&bg, &light_frame);
bg.text.line_space = LV_DPI / 12;
theme.ddlist.bg = &bg;
theme.ddlist.sel = &dark_plain;
theme.ddlist.sb = &dark_frame;
theme.style.ddlist.bg = &bg;
theme.style.ddlist.sel = &dark_plain;
theme.style.ddlist.sb = &dark_frame;
#endif
}
@@ -373,8 +373,8 @@ static void roller_init(void)
lv_style_copy(&bg, &light_frame);
bg.text.line_space = LV_DPI / 12;
theme.roller.bg = &bg;
theme.roller.sel = &dark_frame;
theme.style.roller.bg = &bg;
theme.style.roller.sel = &dark_frame;
#endif
}
@@ -383,13 +383,13 @@ static void tabview_init(void)
#if USE_LV_TABVIEW != 0
theme.tabview.bg = &light_frame;
theme.tabview.indic = &light_plain;
theme.tabview.btn.bg = &lv_style_transp_fit;
theme.tabview.btn.rel = &light_frame;
theme.tabview.btn.pr = &dark_frame;
theme.tabview.btn.tgl_rel = &dark_frame;
theme.tabview.btn.tgl_pr = &light_frame;
theme.style.tabview.bg = &light_frame;
theme.style.tabview.indic = &light_plain;
theme.style.tabview.btn.bg = &lv_style_transp_fit;
theme.style.tabview.btn.rel = &light_frame;
theme.style.tabview.btn.pr = &dark_frame;
theme.style.tabview.btn.tgl_rel = &dark_frame;
theme.style.tabview.btn.tgl_pr = &light_frame;
#endif
}
@@ -402,13 +402,13 @@ static void win_init(void)
win_header.body.padding.hor = LV_DPI / 30;
win_header.body.padding.ver = LV_DPI / 30;
theme.win.bg = &light_frame;
theme.win.sb = &dark_frame;
theme.win.header = &win_header;
theme.win.content.bg = &lv_style_transp;
theme.win.content.scrl = &lv_style_transp;
theme.win.btn.rel = &light_frame;
theme.win.btn.pr = &dark_frame;
theme.style.win.bg = &light_frame;
theme.style.win.sb = &dark_frame;
theme.style.win.header = &win_header;
theme.style.win.content.bg = &lv_style_transp;
theme.style.win.content.scrl = &lv_style_transp;
theme.style.win.btn.rel = &light_frame;
theme.style.win.btn.pr = &dark_frame;
#endif
}

View File

@@ -132,8 +132,8 @@ static void basic_init(void)
sb.body.padding.ver = 1;
sb.body.padding.inner = LV_DPI / 15; /*Scrollbar width*/
theme.bg = &bg;
theme.panel = &panel;
theme.style.bg = &bg;
theme.style.panel = &panel;
}
@@ -188,11 +188,11 @@ static void btn_init(void)
btn_ina.text.font = _font;
btn_ina.text.color = lv_color_hsv_to_rgb(_hue, 10, 90);
theme.btn.rel = &btn_rel;
theme.btn.pr = &btn_pr;
theme.btn.tgl_rel = &btn_trel;
theme.btn.tgl_pr = &btn_tpr;
theme.btn.ina = &btn_ina;
theme.style.btn.rel = &btn_rel;
theme.style.btn.pr = &btn_pr;
theme.style.btn.tgl_rel = &btn_trel;
theme.style.btn.tgl_pr = &btn_tpr;
theme.style.btn.ina = &btn_ina;
#endif
}
@@ -214,9 +214,9 @@ static void label_init(void)
lv_style_copy(&label_hint, &label_prim);
label_hint.text.color = lv_color_hsv_to_rgb(_hue, 20, 70);
theme.label.prim = &label_prim;
theme.label.sec = &label_sec;
theme.label.hint = &label_hint;
theme.style.label.prim = &label_prim;
theme.style.label.sec = &label_sec;
theme.style.label.hint = &label_hint;
#endif
}
@@ -248,8 +248,8 @@ static void bar_init(void)
bar_indic.body.main_color = lv_color_hsv_to_rgb(_hue, 40, 80);
bar_indic.body.grad_color = lv_color_hsv_to_rgb(_hue, 40, 80);
theme.bar.bg = &bar_bg;
theme.bar.indic = &bar_indic;
theme.style.bar.bg = &bar_bg;
theme.style.bar.indic = &bar_indic;
#endif
}
@@ -265,8 +265,8 @@ static void img_init(void)
img_light.image.color = lv_color_hsv_to_rgb(_hue, 85, 65);
img_light.image.intense = LV_OPA_80;
theme.img.light = &img_light;
theme.img.dark = &img_dark;
theme.style.img.light = &img_light;
theme.style.img.dark = &img_dark;
#endif
}
@@ -278,7 +278,7 @@ static void line_init(void)
line_decor.line.color = lv_color_hsv_to_rgb(_hue, 50, 50);
line_decor.line.width = 1;
theme.line.decor = &line_decor;
theme.style.line.decor = &line_decor;
#endif
}
@@ -296,7 +296,7 @@ static void led_init(void)
led.body.border.color = lv_color_hsv_to_rgb(_hue, 60, 60);
led.body.shadow.color = lv_color_hsv_to_rgb(_hue, 100, 100);
theme.led = &led;
theme.style.led = &led;
#endif
}
@@ -312,9 +312,9 @@ static void slider_init(void)
slider_knob.body.border.color = LV_COLOR_ORANGE;
slider_knob.body.border.opa = LV_OPA_50;
theme.slider.bg = &bar_bg;
theme.slider.indic = &bar_indic;
theme.slider.knob = &slider_knob;
theme.style.slider.bg = &bar_bg;
theme.style.slider.indic = &bar_indic;
theme.style.slider.knob = &slider_knob;
#endif
}
@@ -339,10 +339,10 @@ static void sw_init(void)
lv_style_copy(&sw_knob, &slider_knob);
sw_knob.body.opa = LV_OPA_80;
theme.sw.bg = &sw_bg;
theme.sw.indic = &sw_indic;
theme.sw.knob_off = &sw_knob;
theme.sw.knob_on = &sw_knob;
theme.style.sw.bg = &sw_bg;
theme.style.sw.indic = &sw_indic;
theme.style.sw.knob_off = &sw_knob;
theme.style.sw.knob_on = &sw_knob;
#endif
}
@@ -357,7 +357,7 @@ static void lmeter_init(void)
lmeter_bg.line.color = LV_COLOR_HEX3(0x500);
lmeter_bg.line.width = 2;
theme.lmeter = &lmeter_bg;
theme.style.lmeter = &lmeter_bg;
#endif
}
@@ -378,7 +378,7 @@ static void gauge_init(void)
gauge_bg.text.color = lv_color_hsv_to_rgb(_hue, 10, 90);
gauge_bg.text.font = _font;
theme.gauge = &gauge_bg;
theme.style.gauge = &gauge_bg;
#endif
}
@@ -395,7 +395,7 @@ static void arc_init(void)
/*For preloader*/
arc.body.border.width = 0;
theme.arc = &arc;
theme.style.arc = &arc;
#endif
}
@@ -403,14 +403,14 @@ static void preload_init(void)
{
#if USE_LV_PRELOAD != 0
theme.preload = theme.arc;
theme.style.preload = theme.style.arc;
#endif
}
static void chart_init(void)
{
#if USE_LV_CHART
theme.chart = &panel;
theme.style.chart = &panel;
#endif
}
@@ -428,7 +428,7 @@ static void calendar_init(void)
static lv_style_t week_box;
lv_style_copy(&week_box, &def);
week_box.body.empty = 1;
week_box.body.border.color = theme.panel->body.border.color;
week_box.body.border.color = theme.style.panel->body.border.color;
week_box.body.padding.ver = LV_DPI / 20;
static lv_style_t today_box;
@@ -438,13 +438,13 @@ static void calendar_init(void)
today_box.body.padding.ver = LV_DPI / 20;
today_box.body.radius = 0;
theme.calendar.bg = theme.panel;
theme.calendar.header = theme.label.prim;
theme.calendar.inactive_days = theme.label.hint;
theme.calendar.highlighted_days = theme.label.sec;
theme.calendar.week_box = &week_box;
theme.calendar.today_box = &week_box;
theme.calendar.header_pr = theme.label.prim;
theme.style.calendar.bg = theme.style.panel;
theme.style.calendar.header = theme.style.label.prim;
theme.style.calendar.inactive_days = theme.style.label.hint;
theme.style.calendar.highlighted_days = theme.style.label.sec;
theme.style.calendar.week_box = &week_box;
theme.style.calendar.today_box = &week_box;
theme.style.calendar.header_pr = theme.style.label.prim;
#endif
}
@@ -490,12 +490,12 @@ static void cb_init(void)
cb_ina.body.main_color = LV_COLOR_PURPLE;
cb_ina.body.grad_color = LV_COLOR_SILVER;
theme.cb.bg = &cb_bg;
theme.cb.box.rel = &cb_rel;
theme.cb.box.pr = &cb_pr;
theme.cb.box.tgl_rel = &cb_trel;
theme.cb.box.tgl_pr = &cb_tpr;
theme.cb.box.ina = &cb_ina;
theme.style.cb.bg = &cb_bg;
theme.style.cb.box.rel = &cb_rel;
theme.style.cb.box.pr = &cb_pr;
theme.style.cb.box.tgl_rel = &cb_trel;
theme.style.cb.box.tgl_pr = &cb_tpr;
theme.style.cb.box.ina = &cb_ina;
#endif
}
@@ -529,24 +529,24 @@ static void btnm_init(void)
lv_style_copy(&btnm_ina, &btnm_rel);
btnm_ina.text.color = lv_color_hsv_to_rgb(_hue, 10, 60);
theme.btnm.bg = &btnm_bg;
theme.btnm.btn.rel = &btnm_rel;
theme.btnm.btn.pr = &btnm_pr;
theme.btnm.btn.tgl_rel = &btnm_trel;
theme.btnm.btn.tgl_pr = &btnm_pr;
theme.btnm.btn.ina = &btnm_ina;
theme.style.btnm.bg = &btnm_bg;
theme.style.btnm.btn.rel = &btnm_rel;
theme.style.btnm.btn.pr = &btnm_pr;
theme.style.btnm.btn.tgl_rel = &btnm_trel;
theme.style.btnm.btn.tgl_pr = &btnm_pr;
theme.style.btnm.btn.ina = &btnm_ina;
#endif
}
static void kb_init(void)
{
#if USE_LV_KB
theme.kb.bg = &btnm_bg;
theme.kb.btn.rel = &btnm_rel;
theme.kb.btn.pr = &btnm_pr;
theme.kb.btn.tgl_rel = &btnm_trel;
theme.kb.btn.tgl_pr = &btnm_pr;
theme.kb.btn.ina = &btnm_ina;
theme.style.kb.bg = &btnm_bg;
theme.style.kb.btn.rel = &btnm_rel;
theme.style.kb.btn.pr = &btnm_pr;
theme.style.kb.btn.tgl_rel = &btnm_trel;
theme.style.kb.btn.tgl_pr = &btnm_pr;
theme.style.kb.btn.ina = &btnm_ina;
#endif
}
@@ -558,38 +558,38 @@ static void mbox_init(void)
lv_style_copy(&mbox_bg, &panel);
mbox_bg.body.shadow.width = LV_DPI / 12;
theme.mbox.bg = &mbox_bg;
theme.mbox.btn.bg = &lv_style_transp;
theme.mbox.btn.rel = &btn_trel;
theme.mbox.btn.pr = &btn_tpr;
theme.style.mbox.bg = &mbox_bg;
theme.style.mbox.btn.bg = &lv_style_transp;
theme.style.mbox.btn.rel = &btn_trel;
theme.style.mbox.btn.pr = &btn_tpr;
#endif
}
static void page_init(void)
{
#if USE_LV_PAGE
theme.page.bg = &panel;
theme.page.scrl = &lv_style_transp_fit;
theme.page.sb = &sb;
theme.style.page.bg = &panel;
theme.style.page.scrl = &lv_style_transp_fit;
theme.style.page.sb = &sb;
#endif
}
static void ta_init(void)
{
#if USE_LV_TA
theme.ta.area = &panel;
theme.ta.oneline = &panel;
theme.ta.cursor = NULL;
theme.ta.sb = &sb;
theme.style.ta.area = &panel;
theme.style.ta.oneline = &panel;
theme.style.ta.cursor = NULL;
theme.style.ta.sb = &sb;
#endif
}
static void spinbox_init(void)
{
#if USE_LV_SPINBOX
theme.spinbox.bg= &panel;
theme.spinbox.cursor = theme.ta.cursor;
theme.spinbox.sb = theme.ta.sb;
theme.style.spinbox.bg= &panel;
theme.style.spinbox.cursor = theme.style.ta.cursor;
theme.style.spinbox.sb = theme.style.ta.sb;
#endif
}
@@ -620,14 +620,14 @@ static void list_init(void)
list_bg.body.padding.hor = 0;
list_bg.body.padding.ver = 0;
theme.list.sb = &sb;
theme.list.bg = &list_bg;
theme.list.scrl = &lv_style_transp_tight;
theme.list.btn.rel = &list_rel;
theme.list.btn.pr = &list_pr;
theme.list.btn.tgl_rel = &list_trel;
theme.list.btn.tgl_pr = &list_tpr;
theme.list.btn.ina = &list_ina;
theme.style.list.sb = &sb;
theme.style.list.bg = &list_bg;
theme.style.list.scrl = &lv_style_transp_tight;
theme.style.list.btn.rel = &list_rel;
theme.style.list.btn.pr = &list_pr;
theme.style.list.btn.tgl_rel = &list_trel;
theme.style.list.btn.tgl_pr = &list_tpr;
theme.style.list.btn.ina = &list_ina;
#endif
}
@@ -645,9 +645,9 @@ static void ddlist_init(void)
ddlist_sel.body.opa = LV_OPA_COVER;
ddlist_sel.body.radius = 0;
theme.ddlist.bg = &ddlist_bg;
theme.ddlist.sel = &ddlist_sel;
theme.ddlist.sb = &sb;
theme.style.ddlist.bg = &ddlist_bg;
theme.style.ddlist.sel = &ddlist_sel;
theme.style.ddlist.sb = &sb;
#endif
}
@@ -671,8 +671,8 @@ static void roller_init(void)
roller_sel.text.opa = LV_OPA_COVER;
roller_sel.text.color = lv_color_hsv_to_rgb(_hue, 70, 95);
theme.roller.bg = &roller_bg;
theme.roller.sel = &roller_sel;
theme.style.roller.bg = &roller_bg;
theme.style.roller.sel = &roller_sel;
#endif
}
@@ -725,22 +725,22 @@ static void tabview_init(void)
tab_indic.body.grad_color = lv_color_hsv_to_rgb(_hue, 80, 87);
tab_indic.body.padding.inner = LV_DPI / 10; /*Indicator height*/
theme.tabview.bg = &bg;
theme.tabview.indic = &tab_indic;
theme.tabview.btn.bg = &lv_style_transp_tight;
theme.tabview.btn.rel = &tab_rel;
theme.tabview.btn.pr = &tab_pr;
theme.tabview.btn.tgl_rel = &tab_trel;
theme.tabview.btn.tgl_pr = &tab_tpr;
theme.style.tabview.bg = &bg;
theme.style.tabview.indic = &tab_indic;
theme.style.tabview.btn.bg = &lv_style_transp_tight;
theme.style.tabview.btn.rel = &tab_rel;
theme.style.tabview.btn.pr = &tab_pr;
theme.style.tabview.btn.tgl_rel = &tab_trel;
theme.style.tabview.btn.tgl_pr = &tab_tpr;
#endif
}
static void tileview_init(void)
{
#if USE_LV_TILEVIEW != 0
theme.tileview.bg = &lv_style_transp_tight;
theme.tileview.scrl = &lv_style_transp_tight;
theme.tileview.sb = theme.page.sb;
theme.style.tileview.bg = &lv_style_transp_tight;
theme.style.tileview.scrl = &lv_style_transp_tight;
theme.style.tileview.sb = theme.style.page.sb;
#endif
}
@@ -752,8 +752,8 @@ static void table_init(void)
cell.body.radius = 0;
cell.body.border.width = 1;
theme.table.bg = &lv_style_transp_tight;
theme.table.cell = &cell;
theme.style.table.bg = &lv_style_transp_tight;
theme.style.table.cell = &cell;
#endif
}
@@ -771,13 +771,13 @@ static void win_init(void)
win_header.body.border.color = lv_color_hsv_to_rgb(_hue, 20, 80);
win_header.text.color = lv_color_hsv_to_rgb(_hue, 5, 100);
theme.win.bg = &bg;
theme.win.sb = &sb;
theme.win.header = &win_header;
theme.win.content.bg = &lv_style_transp;
theme.win.content.scrl = &lv_style_transp;
theme.win.btn.rel = &btn_rel;
theme.win.btn.pr = &btn_pr;
theme.style.win.bg = &bg;
theme.style.win.sb = &sb;
theme.style.win.header = &win_header;
theme.style.win.content.bg = &lv_style_transp;
theme.style.win.content.scrl = &lv_style_transp;
theme.style.win.btn.rel = &btn_rel;
theme.style.win.btn.pr = &btn_pr;
#endif
}

View File

@@ -81,8 +81,8 @@ static void basic_init(void)
panel.body.padding.hor = LV_DPI / 10;
panel.line.color = lv_color_hsv_to_rgb(_hue, 20, 40);
panel.line.width = 1;
theme.bg = &bg;
theme.panel = &def;
theme.style.bg = &bg;
theme.style.panel = &def;
}
static void cont_init(void)
@@ -90,7 +90,7 @@ static void cont_init(void)
#if USE_LV_CONT != 0
theme.cont = &panel;
theme.style.cont = &panel;
#endif
}
static void btn_init(void)
@@ -132,11 +132,11 @@ static void btn_init(void)
btn_ina.text.color = LV_COLOR_HEX3(0xaaa);
btn_ina.body.shadow.width = 0;
theme.btn.rel = &btn_rel;
theme.btn.pr = &btn_pr;
theme.btn.tgl_rel = &btn_tgl_rel;
theme.btn.tgl_pr = &btn_tgl_pr;
theme.btn.ina = &btn_ina;
theme.style.btn.rel = &btn_rel;
theme.style.btn.pr = &btn_pr;
theme.style.btn.tgl_rel = &btn_tgl_rel;
theme.style.btn.tgl_pr = &btn_tgl_pr;
theme.style.btn.ina = &btn_ina;
#endif
}
@@ -154,9 +154,9 @@ static void label_init(void)
lv_style_copy(&hint, &bg);
hint.text.color = lv_color_hsv_to_rgb(_hue, 20, 55);
theme.label.prim = &prim;
theme.label.sec = &sec;
theme.label.hint = &hint;
theme.style.label.prim = &prim;
theme.style.label.sec = &sec;
theme.style.label.hint = &hint;
#endif
}
@@ -165,7 +165,7 @@ static void line_init(void)
#if USE_LV_LINE != 0
theme.line.decor = &def;
theme.style.line.decor = &def;
#endif
}
@@ -183,7 +183,7 @@ static void led_init(void)
led.body.border.color = lv_color_hsv_to_rgb(_hue, 60, 60);
led.body.shadow.color = lv_color_hsv_to_rgb(_hue, 100, 100);
theme.led = &led;
theme.style.led = &led;
#endif
}
@@ -192,8 +192,8 @@ static void img_init(void)
#if USE_LV_IMG != 0
theme.img.light = &def;
theme.img.dark = &def;
theme.style.img.light = &def;
theme.style.img.dark = &def;
#endif
}
@@ -215,8 +215,8 @@ static void bar_init(void)
bar_indic.body.padding.hor = 0;
bar_indic.body.padding.ver = 0;
theme.bar.bg = &bar_bg;
theme.bar.indic = &bar_indic;
theme.style.bar.bg = &bar_bg;
theme.style.bar.indic = &bar_indic;
#endif
}
@@ -227,9 +227,9 @@ static void slider_init(void)
lv_style_copy(&slider_knob, &btn_rel);
slider_knob.body.radius = LV_RADIUS_CIRCLE;
theme.slider.bg = &bar_bg;
theme.slider.indic = &bar_indic;
theme.slider.knob = &slider_knob;
theme.style.slider.bg = &bar_bg;
theme.style.slider.indic = &bar_indic;
theme.style.slider.knob = &slider_knob;
#endif
}
@@ -238,10 +238,10 @@ static void sw_init(void)
#if USE_LV_SW != 0
theme.sw.bg = &bar_bg;
theme.sw.indic = &bar_indic;
theme.sw.knob_off = &slider_knob;
theme.sw.knob_on = &slider_knob;
theme.style.sw.bg = &bar_bg;
theme.style.sw.indic = &bar_indic;
theme.style.sw.knob_off = &slider_knob;
theme.style.sw.knob_on = &slider_knob;
#endif
}
@@ -259,7 +259,7 @@ static void lmeter_init(void)
lmeter_bg.line.width = 1;
lmeter_bg.text.color = LV_COLOR_HEX3(0xddd);
theme.lmeter = &lmeter_bg;
theme.style.lmeter = &lmeter_bg;
#endif
}
@@ -274,7 +274,7 @@ static void gauge_init(void)
gauge_bg.line.width = 1;
gauge_bg.text.color = LV_COLOR_HEX3(0xddd);
theme.gauge = &gauge_bg;
theme.style.gauge = &gauge_bg;
#endif
}
@@ -294,7 +294,7 @@ static void arc_init(void)
arc.body.padding.hor = 1;
arc.body.padding.ver = 1;
theme.arc = &arc;
theme.style.arc = &arc;
#endif
}
@@ -302,14 +302,14 @@ static void preload_init(void)
{
#if USE_LV_PRELOAD != 0
theme.preload = theme.arc;
theme.style.preload = theme.style.arc;
#endif
}
static void chart_init(void)
{
#if USE_LV_CHART
theme.chart = &panel;
theme.style.chart = &panel;
#endif
}
@@ -361,13 +361,13 @@ static void calendar_init(void)
lv_style_copy(&ina_days, &bg);
ina_days.text.color = lv_color_hsv_to_rgb(_hue, 0, 60);
theme.calendar.bg = &cal_bg;
theme.calendar.header = &cal_header;
theme.calendar.week_box = &week_box;
theme.calendar.today_box = &today_box;
theme.calendar.highlighted_days = &highlighted_days;
theme.calendar.day_names = &cal_bg;
theme.calendar.inactive_days = &ina_days;
theme.style.calendar.bg = &cal_bg;
theme.style.calendar.header = &cal_header;
theme.style.calendar.week_box = &week_box;
theme.style.calendar.today_box = &today_box;
theme.style.calendar.highlighted_days = &highlighted_days;
theme.style.calendar.day_names = &cal_bg;
theme.style.calendar.inactive_days = &ina_days;
#endif
}
@@ -407,12 +407,12 @@ static void cb_init(void)
ina.body.grad_color = LV_COLOR_HEX3(0x777);
ina.body.border.width = 0;
theme.cb.bg = &lv_style_transp;
theme.cb.box.rel = &rel;
theme.cb.box.pr = &pr;
theme.cb.box.tgl_rel = &tgl_rel;
theme.cb.box.tgl_pr = &tgl_pr;
theme.cb.box.ina = &def;
theme.style.cb.bg = &lv_style_transp;
theme.style.cb.box.rel = &rel;
theme.style.cb.box.pr = &pr;
theme.style.cb.box.tgl_rel = &tgl_rel;
theme.style.cb.box.tgl_pr = &tgl_pr;
theme.style.cb.box.ina = &def;
#endif
}
@@ -453,24 +453,24 @@ static void btnm_init(void)
ina.body.border.width = rel.body.border.width;
ina.body.radius = rel.body.radius;
theme.btnm.bg = &btnm_bg;
theme.btnm.btn.rel = &rel;
theme.btnm.btn.pr = &pr;
theme.btnm.btn.tgl_rel = &tgl_rel;
theme.btnm.btn.tgl_pr = &tgl_pr;
theme.btnm.btn.ina = &ina;
theme.style.btnm.bg = &btnm_bg;
theme.style.btnm.btn.rel = &rel;
theme.style.btnm.btn.pr = &pr;
theme.style.btnm.btn.tgl_rel = &tgl_rel;
theme.style.btnm.btn.tgl_pr = &tgl_pr;
theme.style.btnm.btn.ina = &ina;
#endif
}
static void kb_init(void)
{
#if USE_LV_KB
theme.kb.bg = &bg;
theme.kb.btn.rel = &btn_rel;
theme.kb.btn.pr = &btn_pr;
theme.kb.btn.tgl_rel = &btn_tgl_rel;
theme.kb.btn.tgl_pr = &btn_tgl_pr;
theme.kb.btn.ina = &btn_ina;
theme.style.kb.bg = &bg;
theme.style.kb.btn.rel = &btn_rel;
theme.style.kb.btn.pr = &btn_pr;
theme.style.kb.btn.tgl_rel = &btn_tgl_rel;
theme.style.kb.btn.tgl_pr = &btn_tgl_pr;
theme.style.kb.btn.ina = &btn_ina;
#endif
}
@@ -487,10 +487,10 @@ static void mbox_init(void)
mbox_bg.body.shadow.width = LV_DPI / 10;
mbox_bg.body.shadow.color = LV_COLOR_HEX3(0x222);
mbox_bg.body.radius = LV_DPI / 20;
theme.mbox.bg = &mbox_bg;
theme.mbox.btn.bg = &lv_style_transp;
theme.mbox.btn.rel = &btn_rel;
theme.mbox.btn.pr = &btn_pr;
theme.style.mbox.bg = &mbox_bg;
theme.style.mbox.btn.bg = &lv_style_transp;
theme.style.mbox.btn.rel = &btn_rel;
theme.style.mbox.btn.pr = &btn_pr;
#endif
}
@@ -506,28 +506,28 @@ static void page_init(void)
page_scrl.body.border.width = 1;
page_scrl.body.radius = LV_DPI / 20;
theme.page.bg = &panel;
theme.page.scrl = &page_scrl;
theme.page.sb = &sb;
theme.style.page.bg = &panel;
theme.style.page.scrl = &page_scrl;
theme.style.page.sb = &sb;
#endif
}
static void ta_init(void)
{
#if USE_LV_TA
theme.ta.area = &panel;
theme.ta.oneline = &panel;
theme.ta.cursor = NULL;
theme.ta.sb = &def;
theme.style.ta.area = &panel;
theme.style.ta.oneline = &panel;
theme.style.ta.cursor = NULL;
theme.style.ta.sb = &def;
#endif
}
static void spinbox_init(void)
{
#if USE_LV_SPINBOX
theme.spinbox.bg= &panel;
theme.spinbox.cursor = theme.ta.cursor;
theme.spinbox.sb = theme.ta.sb;
theme.style.spinbox.bg= &panel;
theme.style.spinbox.cursor = theme.style.ta.cursor;
theme.style.spinbox.sb = theme.style.ta.sb;
#endif
}
@@ -571,14 +571,14 @@ static void list_init(void)
list_btn_tgl_pr.body.main_color = btn_tgl_pr.body.main_color;
list_btn_tgl_pr.body.grad_color = btn_tgl_pr.body.grad_color;
theme.list.sb = &sb;
theme.list.bg = &list_bg;
theme.list.scrl = &lv_style_transp_tight;
theme.list.btn.rel = &list_btn_rel;
theme.list.btn.pr = &list_btn_pr;
theme.list.btn.tgl_rel = &list_btn_tgl_rel;
theme.list.btn.tgl_pr = &list_btn_tgl_pr;
theme.list.btn.ina = &def;
theme.style.list.sb = &sb;
theme.style.list.bg = &list_bg;
theme.style.list.scrl = &lv_style_transp_tight;
theme.style.list.btn.rel = &list_btn_rel;
theme.style.list.btn.pr = &list_btn_pr;
theme.style.list.btn.tgl_rel = &list_btn_tgl_rel;
theme.style.list.btn.tgl_pr = &list_btn_tgl_pr;
theme.style.list.btn.ina = &def;
#endif
}
@@ -596,9 +596,9 @@ static void ddlist_init(void)
ddlist_sel.body.grad_color = lv_color_hsv_to_rgb(_hue, 20, 50);
ddlist_sel.body.radius = 0;
theme.ddlist.bg = &ddlist_bg;
theme.ddlist.sel = &ddlist_sel;
theme.ddlist.sb = &def;
theme.style.ddlist.bg = &ddlist_bg;
theme.style.ddlist.sel = &ddlist_sel;
theme.style.ddlist.sb = &def;
#endif
}
@@ -613,30 +613,30 @@ static void roller_init(void)
roller_bg.text.color = lv_color_hsv_to_rgb(_hue, 5, 70);
roller_bg.text.opa = LV_OPA_60;
theme.roller.bg = &roller_bg;
theme.roller.sel = &ddlist_sel;
theme.style.roller.bg = &roller_bg;
theme.style.roller.sel = &ddlist_sel;
#endif
}
static void tabview_init(void)
{
#if USE_LV_TABVIEW != 0
theme.tabview.bg = &bg;
theme.tabview.indic = &lv_style_transp;
theme.tabview.btn.bg = &lv_style_transp;
theme.tabview.btn.rel = &btn_rel;
theme.tabview.btn.pr = &btn_pr;
theme.tabview.btn.tgl_rel = &btn_tgl_rel;
theme.tabview.btn.tgl_pr = &btn_tgl_pr;
theme.style.tabview.bg = &bg;
theme.style.tabview.indic = &lv_style_transp;
theme.style.tabview.btn.bg = &lv_style_transp;
theme.style.tabview.btn.rel = &btn_rel;
theme.style.tabview.btn.pr = &btn_pr;
theme.style.tabview.btn.tgl_rel = &btn_tgl_rel;
theme.style.tabview.btn.tgl_pr = &btn_tgl_pr;
#endif
}
static void tileview_init(void)
{
#if USE_LV_TILEVIEW != 0
theme.tileview.bg = &lv_style_transp_tight;
theme.tileview.scrl = &lv_style_transp_tight;
theme.tileview.sb = theme.page.sb;
theme.style.tileview.bg = &lv_style_transp_tight;
theme.style.tileview.scrl = &lv_style_transp_tight;
theme.style.tileview.sb = theme.style.page.sb;
#endif
}
@@ -651,8 +651,8 @@ static void table_init(void)
cell.body.padding.ver = LV_DPI / 12;
theme.table.bg = &lv_style_transp_tight;
theme.table.cell = &cell;
theme.style.table.bg = &lv_style_transp_tight;
theme.style.table.cell = &cell;
#endif
}
@@ -679,13 +679,13 @@ static void win_init(void)
win_btn_pr.body.grad_color = lv_color_hsv_to_rgb(_hue, 10, 10);
win_btn_pr.text.color = LV_COLOR_HEX3(0xaaa);
theme.win.bg = &win_bg;
theme.win.sb = &sb;
theme.win.header = &win_header;
theme.win.content.bg = &lv_style_transp;
theme.win.content.scrl = &lv_style_transp;
theme.win.btn.rel = &lv_style_transp;
theme.win.btn.pr = &win_btn_pr;
theme.style.win.bg = &win_bg;
theme.style.win.sb = &sb;
theme.style.win.header = &win_header;
theme.style.win.content.bg = &lv_style_transp;
theme.style.win.content.scrl = &lv_style_transp;
theme.style.win.btn.rel = &lv_style_transp;
theme.style.win.btn.pr = &win_btn_pr;
#endif
}

View File

@@ -47,8 +47,8 @@ static void basic_init(void)
lv_style_copy(&def, &lv_style_pretty); /*Initialize the default style*/
def.text.font = _font;
theme.bg = &def;
theme.panel = &def;
theme.style.bg = &def;
theme.style.panel = &def;
}
@@ -57,7 +57,7 @@ static void cont_init(void)
#if USE_LV_CONT != 0
theme.cont = &def;
theme.style.cont = &def;
#endif
}
@@ -66,22 +66,22 @@ static void btn_init(void)
#if USE_LV_BTN != 0
theme.btn.rel = &def;
theme.btn.pr = &def;
theme.btn.tgl_rel = &def;
theme.btn.tgl_pr = &def;
theme.btn.ina = &def;
theme.style.btn.rel = &def;
theme.style.btn.pr = &def;
theme.style.btn.tgl_rel = &def;
theme.style.btn.tgl_pr = &def;
theme.style.btn.ina = &def;
#endif
}
static void imgbtn_init(void)
{
#if USE_LV_IMGBTN != 0
theme.imgbtn.rel = &def;
theme.imgbtn.pr = &def;
theme.imgbtn.tgl_rel = &def;
theme.imgbtn.tgl_pr = &def;
theme.imgbtn.ina = &def;
theme.style.imgbtn.rel = &def;
theme.style.imgbtn.pr = &def;
theme.style.imgbtn.tgl_rel = &def;
theme.style.imgbtn.tgl_pr = &def;
theme.style.imgbtn.ina = &def;
#endif
}
@@ -90,9 +90,9 @@ static void label_init(void)
#if USE_LV_LABEL != 0
theme.label.prim = &def;
theme.label.sec = &def;
theme.label.hint = &def;
theme.style.label.prim = &def;
theme.style.label.sec = &def;
theme.style.label.hint = &def;
#endif
}
@@ -101,8 +101,8 @@ static void img_init(void)
#if USE_LV_IMG != 0
theme.img.light = &def;
theme.img.dark = &def;
theme.style.img.light = &def;
theme.style.img.dark = &def;
#endif
}
@@ -111,7 +111,7 @@ static void line_init(void)
#if USE_LV_LINE != 0
theme.line.decor = &def;
theme.style.line.decor = &def;
#endif
}
@@ -120,7 +120,7 @@ static void led_init(void)
#if USE_LV_LED != 0
theme.led = &def;
theme.style.led = &def;
#endif
}
@@ -129,8 +129,8 @@ static void bar_init(void)
#if USE_LV_BAR
theme.bar.bg = &def;
theme.bar.indic = &def;
theme.style.bar.bg = &def;
theme.style.bar.indic = &def;
#endif
}
@@ -139,9 +139,9 @@ static void slider_init(void)
#if USE_LV_SLIDER != 0
theme.slider.bg = &def;
theme.slider.indic = &def;
theme.slider.knob = &def;
theme.style.slider.bg = &def;
theme.style.slider.indic = &def;
theme.style.slider.knob = &def;
#endif
}
@@ -150,10 +150,10 @@ static void sw_init(void)
#if USE_LV_SW != 0
theme.sw.bg = &def;
theme.sw.indic = &def;
theme.sw.knob_off = &def;
theme.sw.knob_on = &def;
theme.style.sw.bg = &def;
theme.style.sw.indic = &def;
theme.style.sw.knob_off = &def;
theme.style.sw.knob_on = &def;
#endif
}
@@ -163,7 +163,7 @@ static void lmeter_init(void)
#if USE_LV_LMETER != 0
theme.lmeter = &def;
theme.style.lmeter = &def;
#endif
}
@@ -172,7 +172,7 @@ static void gauge_init(void)
#if USE_LV_GAUGE != 0
theme.gauge = &def;
theme.style.gauge = &def;
#endif
}
@@ -181,7 +181,7 @@ static void arc_init(void)
#if USE_LV_ARC != 0
theme.arc = &def;
theme.style.arc = &def;
#endif
}
@@ -190,7 +190,7 @@ static void preload_init(void)
#if USE_LV_PRELOAD != 0
theme.preload = &def;
theme.style.preload = &def;
#endif
}
@@ -198,7 +198,7 @@ static void chart_init(void)
{
#if USE_LV_CHART
theme.chart = &def;
theme.style.chart = &def;
#endif
}
@@ -206,14 +206,14 @@ static void calendar_init(void)
{
#if USE_LV_CALENDAR
theme.calendar.bg = theme.panel;
theme.calendar.header = &def;
theme.calendar.inactive_days = &def;
theme.calendar.highlighted_days = &def;
theme.calendar.week_box = &def;
theme.calendar.today_box = &def;
theme.calendar.header_pr = &def;
theme.calendar.day_names = &def;
theme.style.calendar.bg = theme.style.panel;
theme.style.calendar.header = &def;
theme.style.calendar.inactive_days = &def;
theme.style.calendar.highlighted_days = &def;
theme.style.calendar.week_box = &def;
theme.style.calendar.today_box = &def;
theme.style.calendar.header_pr = &def;
theme.style.calendar.day_names = &def;
#endif
}
@@ -222,12 +222,12 @@ static void cb_init(void)
#if USE_LV_CB != 0
theme.cb.bg = &def;
theme.cb.box.rel = &def;
theme.cb.box.pr = &def;
theme.cb.box.tgl_rel = &def;
theme.cb.box.tgl_pr = &def;
theme.cb.box.ina = &def;
theme.style.cb.bg = &def;
theme.style.cb.box.rel = &def;
theme.style.cb.box.pr = &def;
theme.style.cb.box.tgl_rel = &def;
theme.style.cb.box.tgl_pr = &def;
theme.style.cb.box.ina = &def;
#endif
}
@@ -237,12 +237,12 @@ static void btnm_init(void)
#if USE_LV_BTNM
theme.btnm.bg = &def;
theme.btnm.btn.rel = &def;
theme.btnm.btn.pr = &def;
theme.btnm.btn.tgl_rel = &def;
theme.btnm.btn.tgl_pr = &def;
theme.btnm.btn.ina = &def;
theme.style.btnm.bg = &def;
theme.style.btnm.btn.rel = &def;
theme.style.btnm.btn.pr = &def;
theme.style.btnm.btn.tgl_rel = &def;
theme.style.btnm.btn.tgl_pr = &def;
theme.style.btnm.btn.ina = &def;
#endif
}
@@ -251,12 +251,12 @@ static void kb_init(void)
#if USE_LV_KB
theme.kb.bg = &def;
theme.kb.btn.rel = &def;
theme.kb.btn.pr = &def;
theme.kb.btn.tgl_rel = &def;
theme.kb.btn.tgl_pr = &def;
theme.kb.btn.ina = &def;
theme.style.kb.bg = &def;
theme.style.kb.btn.rel = &def;
theme.style.kb.btn.pr = &def;
theme.style.kb.btn.tgl_rel = &def;
theme.style.kb.btn.tgl_pr = &def;
theme.style.kb.btn.ina = &def;
#endif
}
@@ -266,10 +266,10 @@ static void mbox_init(void)
#if USE_LV_MBOX
theme.mbox.bg = &def;
theme.mbox.btn.bg = &def;
theme.mbox.btn.rel = &def;
theme.mbox.btn.pr = &def;
theme.style.mbox.bg = &def;
theme.style.mbox.btn.bg = &def;
theme.style.mbox.btn.rel = &def;
theme.style.mbox.btn.pr = &def;
#endif
}
@@ -278,9 +278,9 @@ static void page_init(void)
#if USE_LV_PAGE
theme.page.bg = &def;
theme.page.scrl = &def;
theme.page.sb = &def;
theme.style.page.bg = &def;
theme.style.page.scrl = &def;
theme.style.page.sb = &def;
#endif
}
@@ -289,10 +289,10 @@ static void ta_init(void)
#if USE_LV_TA
theme.ta.area = &def;
theme.ta.oneline = &def;
theme.ta.cursor = NULL; /*Let library to calculate the cursor's style*/
theme.ta.sb = &def;
theme.style.ta.area = &def;
theme.style.ta.oneline = &def;
theme.style.ta.cursor = NULL; /*Let library to calculate the cursor's style*/
theme.style.ta.sb = &def;
#endif
}
@@ -301,14 +301,14 @@ static void list_init(void)
#if USE_LV_LIST != 0
theme.list.sb = &def;
theme.list.bg = &def;
theme.list.scrl = &def;
theme.list.btn.rel = &def;
theme.list.btn.pr = &def;
theme.list.btn.tgl_rel = &def;
theme.list.btn.tgl_pr = &def;
theme.list.btn.ina = &def;
theme.style.list.sb = &def;
theme.style.list.bg = &def;
theme.style.list.scrl = &def;
theme.style.list.btn.rel = &def;
theme.style.list.btn.pr = &def;
theme.style.list.btn.tgl_rel = &def;
theme.style.list.btn.tgl_pr = &def;
theme.style.list.btn.ina = &def;
#endif
}
@@ -317,9 +317,9 @@ static void ddlist_init(void)
#if USE_LV_DDLIST != 0
theme.ddlist.bg = &def;
theme.ddlist.sel = &def;
theme.ddlist.sb = &def;
theme.style.ddlist.bg = &def;
theme.style.ddlist.sel = &def;
theme.style.ddlist.sb = &def;
#endif
}
@@ -328,8 +328,8 @@ static void roller_init(void)
#if USE_LV_ROLLER != 0
theme.roller.bg = &def;
theme.roller.sel = &def;
theme.style.roller.bg = &def;
theme.style.roller.sel = &def;
#endif
}
@@ -338,13 +338,13 @@ static void tabview_init(void)
#if USE_LV_TABVIEW != 0
theme.tabview.bg = &def;
theme.tabview.indic = &def;
theme.tabview.btn.bg = &def;
theme.tabview.btn.rel = &def;
theme.tabview.btn.pr = &def;
theme.tabview.btn.tgl_rel = &def;
theme.tabview.btn.tgl_pr = &def;
theme.style.tabview.bg = &def;
theme.style.tabview.indic = &def;
theme.style.tabview.btn.bg = &def;
theme.style.tabview.btn.rel = &def;
theme.style.tabview.btn.pr = &def;
theme.style.tabview.btn.tgl_rel = &def;
theme.style.tabview.btn.tgl_pr = &def;
#endif
}
@@ -354,13 +354,13 @@ static void win_init(void)
#if USE_LV_WIN != 0
theme.win.bg = &def;
theme.win.sb = &def;
theme.win.header = &def;
theme.win.content.bg = &def;
theme.win.content.scrl = &def;
theme.win.btn.rel = &def;
theme.win.btn.pr = &def;
theme.style.win.bg = &def;
theme.style.win.sb = &def;
theme.style.win.header = &def;
theme.style.win.content.bg = &def;
theme.style.win.content.scrl = &def;
theme.style.win.btn.rel = &def;
theme.style.win.btn.pr = &def;
#endif
}

View File

@@ -78,8 +78,8 @@ static void basic_init(void)
sb.body.radius = LV_RADIUS_CIRCLE;
sb.body.padding.inner = LV_DPI / 10;
theme.bg = &bg;
theme.panel = &panel;
theme.style.bg = &bg;
theme.style.panel = &panel;
}
static void cont_init(void)
@@ -87,7 +87,7 @@ static void cont_init(void)
#if USE_LV_CONT != 0
theme.cont = theme.panel;
theme.style.cont = theme.style.panel;
#endif
}
@@ -120,11 +120,11 @@ static void btn_init(void)
ina.body.border.color = LV_COLOR_HEX3(0xbbb);
ina.text.color = LV_COLOR_HEX3(0xbbb);
theme.btn.rel = &rel;
theme.btn.pr = &pr;
theme.btn.tgl_rel = &pr;
theme.btn.tgl_pr = &tgl_pr;
theme.btn.ina = &ina;
theme.style.btn.rel = &rel;
theme.style.btn.pr = &pr;
theme.style.btn.tgl_rel = &pr;
theme.style.btn.tgl_pr = &tgl_pr;
theme.style.btn.ina = &ina;
#endif
}
@@ -140,9 +140,9 @@ static void label_init(void)
sec.text.color = lv_color_hsv_to_rgb(_hue, 50, 80);
hint.text.color = lv_color_hsv_to_rgb(_hue, 25, 85);
theme.label.prim = &prim;
theme.label.sec = &sec;
theme.label.hint = &hint;
theme.style.label.prim = &prim;
theme.style.label.sec = &sec;
theme.style.label.hint = &hint;
#endif
}
@@ -158,8 +158,8 @@ static void img_init(void)
img_light.image.color = lv_color_hsv_to_rgb(_hue, 85, 55);
img_light.image.intense = LV_OPA_80;
theme.img.light = &img_light;
theme.img.dark = &img_dark;
theme.style.img.light = &img_light;
theme.style.img.dark = &img_dark;
#endif
}
@@ -168,7 +168,7 @@ static void line_init(void)
#if USE_LV_LINE != 0
theme.line.decor = &def;
theme.style.line.decor = &def;
#endif
}
@@ -187,7 +187,7 @@ static void led_init(void)
led.body.border.color = lv_color_hsv_to_rgb(_hue, 60, 60);
led.body.shadow.color = lv_color_hsv_to_rgb(_hue, 80, 100);
theme.led = &led;
theme.style.led = &led;
#endif
}
@@ -212,8 +212,8 @@ static void bar_init(void)
indic.body.padding.ver = LV_DPI / 20;
theme.bar.bg = &bg;
theme.bar.indic = &indic;
theme.style.bar.bg = &bg;
theme.style.bar.indic = &indic;
#endif
}
@@ -223,14 +223,14 @@ static void slider_init(void)
static lv_style_t knob;
lv_style_copy(&knob, &def);
knob.body.main_color = theme.bar.indic->body.main_color;
knob.body.main_color = theme.style.bar.indic->body.main_color;
knob.body.grad_color = knob.body.main_color;
knob.body.radius = LV_RADIUS_CIRCLE;
knob.body.border.width = 0;
theme.slider.bg = theme.bar.bg;
theme.slider.indic = theme.bar.indic;
theme.slider.knob = &knob;
theme.style.slider.bg = theme.style.bar.bg;
theme.style.slider.indic = theme.style.bar.indic;
theme.style.slider.knob = &knob;
#endif
}
@@ -239,22 +239,22 @@ static void sw_init(void)
#if USE_LV_SW != 0
static lv_style_t indic;
lv_style_copy(&indic, theme.slider.indic);
lv_style_copy(&indic, theme.style.slider.indic);
indic.body.radius = LV_RADIUS_CIRCLE;
indic.body.main_color = lv_color_hsv_to_rgb(_hue, 15, 95);
indic.body.grad_color = indic.body.main_color;
indic.body.border.width = theme.slider.bg->body.border.width;
indic.body.border.color = theme.slider.bg->body.border.color;
indic.body.border.opa = theme.slider.bg->body.border.opa;
indic.body.border.width = theme.style.slider.bg->body.border.width;
indic.body.border.color = theme.style.slider.bg->body.border.color;
indic.body.border.opa = theme.style.slider.bg->body.border.opa;
indic.body.padding.hor = 0;
indic.body.padding.ver = 0;
theme.sw.bg = theme.slider.bg;
theme.sw.indic = &indic;
theme.sw.knob_off = theme.slider.knob;
theme.sw.knob_on = theme.slider.knob;
theme.style.sw.bg = theme.style.slider.bg;
theme.style.sw.indic = &indic;
theme.style.sw.knob_off = theme.style.slider.knob;
theme.style.sw.knob_on = theme.style.slider.knob;
#endif
}
@@ -271,7 +271,7 @@ static void lmeter_init(void)
lmeter.body.grad_color = lmeter.body.main_color;
lmeter.body.padding.hor = LV_DPI / 8;
theme.lmeter = &lmeter;
theme.style.lmeter = &lmeter;
#endif
}
@@ -288,7 +288,7 @@ static void gauge_init(void)
gauge.body.padding.hor = LV_DPI / 16;
gauge.body.border.color = LV_COLOR_HEX3(0x666); /*Needle middle color*/
theme.gauge = &gauge;
theme.style.gauge = &gauge;
#endif
}
@@ -305,7 +305,7 @@ static void arc_init(void)
/*For preloader*/
arc.body.border.width = 0;
theme.arc = &arc;
theme.style.arc = &arc;
#endif
}
@@ -313,14 +313,14 @@ static void preload_init(void)
{
#if USE_LV_PRELOAD != 0
theme.preload = theme.arc;
theme.style.preload = theme.style.arc;
#endif
}
static void chart_init(void)
{
#if USE_LV_CHART
theme.chart = theme.panel;
theme.style.chart = theme.style.panel;
#endif
}
@@ -338,16 +338,16 @@ static void calendar_init(void)
static lv_style_t today_box;
lv_style_copy(&today_box, &def);
today_box.body.empty = 1;
today_box.body.border.color = theme.panel->body.border.color;
today_box.body.border.color = theme.style.panel->body.border.color;
today_box.body.padding.ver = LV_DPI / 20;
today_box.body.radius = LV_RADIUS_CIRCLE;
theme.calendar.bg = theme.panel;
theme.calendar.header = &lv_style_transp;
theme.calendar.inactive_days = &ina_days;
theme.calendar.highlighted_days = &high_days;
theme.calendar.week_box = &lv_style_transp_fit;
theme.calendar.today_box = &today_box;
theme.style.calendar.bg = theme.style.panel;
theme.style.calendar.header = &lv_style_transp;
theme.style.calendar.inactive_days = &ina_days;
theme.style.calendar.highlighted_days = &high_days;
theme.style.calendar.week_box = &lv_style_transp_fit;
theme.style.calendar.today_box = &today_box;
#endif
}
@@ -384,12 +384,12 @@ static void cb_init(void)
ina.body.border.color = LV_COLOR_HEX3(0xaaa);
theme.cb.bg = &lv_style_transp;
theme.cb.box.rel = &rel;
theme.cb.box.pr = &pr;
theme.cb.box.tgl_rel = &tgl_rel;
theme.cb.box.tgl_pr = &tgl_pr;
theme.cb.box.ina = &ina;
theme.style.cb.bg = &lv_style_transp;
theme.style.cb.box.rel = &rel;
theme.style.cb.box.pr = &pr;
theme.style.cb.box.tgl_rel = &tgl_rel;
theme.style.cb.box.tgl_pr = &tgl_pr;
theme.style.cb.box.ina = &ina;
#endif
}
@@ -434,12 +434,12 @@ static void btnm_init(void)
ina.body.grad_color = tgl_pr.body.main_color;
ina.text.color = LV_COLOR_HEX3(0x888);;
theme.btnm.bg = &bg;
theme.btnm.btn.rel = &rel;
theme.btnm.btn.pr = &pr;
theme.btnm.btn.tgl_rel = &tgl_rel;
theme.btnm.btn.tgl_pr = &tgl_pr;
theme.btnm.btn.ina = &ina;
theme.style.btnm.bg = &bg;
theme.style.btnm.btn.rel = &rel;
theme.style.btnm.btn.pr = &pr;
theme.style.btnm.btn.tgl_rel = &tgl_rel;
theme.style.btnm.btn.tgl_pr = &tgl_pr;
theme.style.btnm.btn.ina = &ina;
#endif
}
@@ -489,12 +489,12 @@ static void kb_init(void)
ina.body.grad_color = ina.body.main_color;
ina.text.color = LV_COLOR_HEX3(0xbbb);
theme.kb.bg = &bg;
theme.kb.btn.rel = &rel;
theme.kb.btn.pr = &pr;
theme.kb.btn.tgl_rel = &tgl_rel;
theme.kb.btn.tgl_pr = &tgl_pr;
theme.kb.btn.ina = &ina;
theme.style.kb.bg = &bg;
theme.style.kb.btn.rel = &rel;
theme.style.kb.btn.pr = &pr;
theme.style.kb.btn.tgl_rel = &tgl_rel;
theme.style.kb.btn.tgl_pr = &tgl_pr;
theme.style.kb.btn.ina = &ina;
#endif
}
@@ -503,7 +503,7 @@ static void mbox_init(void)
{
#if USE_LV_MBOX
static lv_style_t bg, rel, pr;
lv_style_copy(&bg, theme.panel);
lv_style_copy(&bg, theme.style.panel);
bg.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 95);
bg.body.grad_color = bg.body.main_color;
bg.text.color = lv_color_hsv_to_rgb(_hue, 40, 25);
@@ -525,10 +525,10 @@ static void mbox_init(void)
pr.body.grad_color = pr.body.main_color;
theme.mbox.bg = &bg;
theme.mbox.btn.bg = &lv_style_transp;
theme.mbox.btn.rel = &rel;
theme.mbox.btn.pr = &pr;
theme.style.mbox.bg = &bg;
theme.style.mbox.btn.bg = &lv_style_transp;
theme.style.mbox.btn.rel = &rel;
theme.style.mbox.btn.pr = &pr;
#endif
}
@@ -537,9 +537,9 @@ static void page_init(void)
#if USE_LV_PAGE
theme.page.bg = theme.panel;
theme.page.scrl = &lv_style_transp;
theme.page.sb = &sb;
theme.style.page.bg = theme.style.panel;
theme.style.page.scrl = &lv_style_transp;
theme.style.page.sb = &sb;
#endif
}
@@ -547,25 +547,25 @@ static void ta_init(void)
{
#if USE_LV_TA
static lv_style_t oneline;
lv_style_copy(&oneline, theme.panel);
lv_style_copy(&oneline, theme.style.panel);
oneline.body.radius = LV_RADIUS_CIRCLE;
oneline.body.padding.ver = LV_DPI / 10;
oneline.body.shadow.width = 0;
theme.ta.area = theme.panel;
theme.ta.oneline = &oneline;
theme.ta.cursor = NULL; /*Let library to calculate the cursor's style*/
theme.ta.sb = &def;
theme.style.ta.area = theme.style.panel;
theme.style.ta.oneline = &oneline;
theme.style.ta.cursor = NULL; /*Let library to calculate the cursor's style*/
theme.style.ta.sb = &def;
#endif
}
static void spinbox_init(void)
{
#if USE_LV_SPINBOX
theme.spinbox.bg= theme.panel;
theme.spinbox.cursor = theme.ta.cursor;
theme.spinbox.sb = theme.ta.sb;
theme.style.spinbox.bg= theme.style.panel;
theme.style.spinbox.cursor = theme.style.ta.cursor;
theme.style.spinbox.sb = theme.style.ta.sb;
#endif
}
@@ -574,7 +574,7 @@ static void list_init(void)
#if USE_LV_LIST != 0
static lv_style_t bg, rel, pr, tgl_rel, tgl_pr, ina;
lv_style_copy(&bg, theme.panel);
lv_style_copy(&bg, theme.style.panel);
bg.body.padding.hor = 0;
bg.body.padding.ver = 0;
@@ -586,25 +586,25 @@ static void list_init(void)
rel.text.color = LV_COLOR_HEX3(0x666);
lv_style_copy(&pr, &rel);
pr.text.color = theme.btn.pr->text.color;
pr.text.color = theme.style.btn.pr->text.color;
lv_style_copy(&tgl_rel, &rel);
tgl_rel.text.color = lv_color_hsv_to_rgb(_hue, 50, 90);
lv_style_copy(&tgl_pr, &rel);
tgl_pr.text.color = theme.btn.tgl_pr->text.color;
tgl_pr.text.color = theme.style.btn.tgl_pr->text.color;
lv_style_copy(&ina, &rel);
ina.text.color = theme.btn.ina->text.color;
ina.text.color = theme.style.btn.ina->text.color;
theme.list.sb = &sb;
theme.list.bg = &bg;
theme.list.scrl = &lv_style_transp_tight;
theme.list.btn.rel = &rel;
theme.list.btn.pr = &pr;
theme.list.btn.tgl_rel = &tgl_rel;
theme.list.btn.tgl_pr = &tgl_pr;
theme.list.btn.ina = &ina;
theme.style.list.sb = &sb;
theme.style.list.bg = &bg;
theme.style.list.scrl = &lv_style_transp_tight;
theme.style.list.btn.rel = &rel;
theme.style.list.btn.pr = &pr;
theme.style.list.btn.tgl_rel = &tgl_rel;
theme.style.list.btn.tgl_pr = &tgl_pr;
theme.style.list.btn.ina = &ina;
#endif
}
@@ -612,7 +612,7 @@ static void ddlist_init(void)
{
#if USE_LV_DDLIST != 0
static lv_style_t bg, sel;
lv_style_copy(&bg, theme.panel);
lv_style_copy(&bg, theme.style.panel);
bg.text.line_space = LV_DPI / 8;
bg.body.padding.hor = LV_DPI / 6;
bg.body.padding.ver = LV_DPI / 8;
@@ -623,9 +623,9 @@ static void ddlist_init(void)
sel.body.border.width = 0;
sel.text.color = lv_color_hsv_to_rgb(_hue, 50, 80);
theme.ddlist.bg = &bg;
theme.ddlist.sel = &sel;
theme.ddlist.sb = &def;
theme.style.ddlist.bg = &bg;
theme.style.ddlist.sel = &sel;
theme.style.ddlist.sb = &def;
#endif
}
@@ -639,12 +639,12 @@ static void roller_init(void)
bg.text.line_space = LV_DPI / 6;
bg.text.color = LV_COLOR_HEX3(0x999);
lv_style_copy(&sel, theme.panel);
lv_style_copy(&sel, theme.style.panel);
sel.body.radius = LV_RADIUS_CIRCLE;
sel.body.empty = 1;
theme.roller.bg = &bg;
theme.roller.sel = &sel;
theme.style.roller.bg = &bg;
theme.style.roller.sel = &sel;
#endif
}
@@ -681,22 +681,22 @@ static void tabview_init(void)
lv_style_copy(&tgl_pr, &rel);
tgl_pr.text.color = lv_color_hsv_to_rgb(_hue, 50, 70);
theme.tabview.bg = theme.bg;
theme.tabview.indic = &indic;
theme.tabview.btn.bg = &btn_bg;
theme.tabview.btn.rel = &rel;
theme.tabview.btn.pr = &pr;
theme.tabview.btn.tgl_rel = &tgl_rel;
theme.tabview.btn.tgl_pr = &tgl_pr;
theme.style.tabview.bg = theme.style.bg;
theme.style.tabview.indic = &indic;
theme.style.tabview.btn.bg = &btn_bg;
theme.style.tabview.btn.rel = &rel;
theme.style.tabview.btn.pr = &pr;
theme.style.tabview.btn.tgl_rel = &tgl_rel;
theme.style.tabview.btn.tgl_pr = &tgl_pr;
#endif
}
static void tileview_init(void)
{
#if USE_LV_TILEVIEW != 0
theme.tileview.bg = &lv_style_transp_tight;
theme.tileview.scrl = &lv_style_transp_tight;
theme.tileview.sb = theme.page.sb;
theme.style.tileview.bg = &lv_style_transp_tight;
theme.style.tileview.scrl = &lv_style_transp_tight;
theme.style.tileview.sb = theme.style.page.sb;
#endif
}
@@ -704,15 +704,15 @@ static void table_init(void)
{
#if USE_LV_TABLE != 0
static lv_style_t cell;
lv_style_copy(&cell, theme.panel);
lv_style_copy(&cell, theme.style.panel);
cell.body.radius = 0;
cell.body.border.width = 1;
cell.body.shadow.width = 0;
cell.body.padding.hor = LV_DPI / 12;
cell.body.padding.ver = LV_DPI / 12;
theme.table.bg = &lv_style_transp_tight;
theme.table.cell = &cell;
theme.style.table.bg = &lv_style_transp_tight;
theme.style.table.cell = &cell;
#endif
}
@@ -736,13 +736,13 @@ static void win_init(void)
lv_style_copy(&pr, &rel);
pr.text.color = LV_COLOR_HEX3(0x333);
theme.win.bg = theme.panel;
theme.win.sb = &sb;
theme.win.header = &header;
theme.win.content.bg = &lv_style_transp;
theme.win.content.scrl = &lv_style_transp;
theme.win.btn.rel = &rel;
theme.win.btn.pr = &pr;
theme.style.win.bg = theme.style.panel;
theme.style.win.sb = &sb;
theme.style.win.header = &header;
theme.style.win.content.bg = &lv_style_transp;
theme.style.win.content.scrl = &lv_style_transp;
theme.style.win.btn.rel = &rel;
theme.style.win.btn.pr = &pr;
#endif
}