1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

arc and preload fixes

This commit is contained in:
Gabor Kiss-Vamosi 2018-09-20 22:14:48 +02:00
parent f7d8cfd5c8
commit f4ac890a3c
3 changed files with 21 additions and 4 deletions

View File

@ -12,6 +12,7 @@
#include "../lv_misc/lv_math.h"
#include "../lv_draw/lv_draw_arc.h"
#include "../lv_themes/lv_theme.h"
/*********************
@ -76,7 +77,14 @@ lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy)
/*Init the new arc arc*/
if(copy == NULL) {
lv_arc_set_style(new_arc, LV_ARC_STYLE_MAIN, &lv_style_plain_color);
/*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->preload);
} else {
lv_arc_set_style(new_arc, LV_ARC_STYLE_MAIN, &lv_style_plain_color);
}
}
/*Copy an existing arc*/
else {
@ -237,7 +245,7 @@ static bool lv_arc_design(lv_obj_t * arc, const lv_area_t * mask, lv_design_mode
lv_style_t cir_style;
lv_style_copy(&cir_style, style);
cir_style.body.empty = 0;
cir_style.body.grad_color = style->body.main_color;
cir_style.body.grad_color = style->line.color;
lv_area_t cir_area;
cir_area.x1 = cir_x + x - thick_2;
cir_area.y1 = cir_y + y - thick_2;

View File

@ -88,7 +88,7 @@ lv_obj_t * lv_img_create(lv_obj_t * par, const lv_obj_t * copy)
* and must be screen sized*/
if(par != NULL) {
ext->auto_size = 1;
lv_obj_set_style(new_img, NULL); /*Inherit the style by default*/
lv_obj_set_style(new_img, &lv_style_plain); /*Inherit the style by default*/
} else {
ext->auto_size = 0;
lv_obj_set_style(new_img, &lv_style_plain); /*Set a style for screens*/

View File

@ -12,6 +12,7 @@
#include "../lv_misc/lv_math.h"
#include "../lv_draw/lv_draw_rect.h"
#include "../lv_draw/lv_draw_arc.h"
#include "../lv_themes/lv_theme.h"
/*********************
* DEFINES
@ -95,8 +96,16 @@ lv_obj_t * lv_preload_create(lv_obj_t * par, const lv_obj_t * copy)
/*Init the new pre loader pre loader*/
if(copy == NULL) {
lv_obj_set_style(new_preload, &lv_style_pretty_color);
lv_obj_set_size(new_preload, LV_DPI / 2, LV_DPI / 2);
/*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);
} else {
lv_obj_set_style(new_preload, &lv_style_pretty_color);
}
}
/*Copy an existing pre loader*/
else {