lv_theme: integrate into the library

add lv_theme
This commit is contained in:
Gabor Kiss-Vamosi
2017-11-16 15:32:33 +01:00
parent e3378d23d4
commit b973dd342a
31 changed files with 1809 additions and 116 deletions

View File

@@ -14,6 +14,7 @@
#include "lv_btn.h"
#include "../lv_obj/lv_group.h"
#include "../lv_draw/lv_draw.h"
#include "../lv_themes/lv_theme.h"
#include "misc/gfx/area.h"
#include "misc/gfx/color.h"
@@ -81,7 +82,18 @@ lv_obj_t * lv_btn_create(lv_obj_t * par, lv_obj_t * copy)
/*If no copy do the basic initialization*/
if(copy == NULL) {
lv_btn_set_layout(new_btn, LV_CONT_LAYOUT_CENTER);
lv_obj_set_style(new_btn, ext->styles[LV_BTN_STATE_REL]);
/*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.md.rel);
lv_btn_set_style(new_btn, LV_BTN_STYLE_PR, th->btn.md.pr);
lv_btn_set_style(new_btn, LV_BTN_STYLE_TGL_REL, th->btn.md.tgl_rel);
lv_btn_set_style(new_btn, LV_BTN_STYLE_TGL_PR, th->btn.md.tgl_pr);
lv_btn_set_style(new_btn, LV_BTN_STYLE_INA, th->btn.md.ina);
} else {
lv_obj_set_style(new_btn, ext->styles[LV_BTN_STATE_REL]);
}
}
/*Copy 'copy'*/
else {