merge dev-7.0

This commit is contained in:
Gabor Kiss-Vamosi
2020-04-06 11:18:38 +02:00
28 changed files with 41494 additions and 11469 deletions

View File

@@ -315,16 +315,23 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
* To create a new font go to: https://littlevgl.com/ttf-font-to-c-array * To create a new font go to: https://littlevgl.com/ttf-font-to-c-array
*/ */
/* Robot fonts with bpp = 4 /* Montserrat fonts with bpp = 4
* https://fonts.google.com/specimen/Roboto */ * https://fonts.google.com/specimen/Montserrat */
#define LV_FONT_ROBOTO_12 0 #define LV_FONT_MONTSERRAT_12 0
#define LV_FONT_ROBOTO_16 1 #define LV_FONT_MONTSERRAT_14 0
#define LV_FONT_ROBOTO_22 0 #define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_ROBOTO_28 0 #define LV_FONT_MONTSERRAT_18 0
#define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0
#define LV_FONT_MONTSERRAT_24 0
#define LV_FONT_MONTSERRAT_26 0
#define LV_FONT_MONTSERRAT_28 0
#define LV_FONT_MONTSERRAT_30 0
#define LV_FONT_MONTSERRAT_32 0
/* Demonstrate special features */ /* Demonstrate special features */
#define LV_FONT_ROBOTO_12_SUBPX 1 #define LV_FONT_MONTSERRAT_12_SUBPX 0
#define LV_FONT_ROBOTO_28_COMPRESSED 1 /*bpp = 3*/ #define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
/*Pixel perfect monospace font /*Pixel perfect monospace font
* http://pelulamu.net/unscii/ */ * http://pelulamu.net/unscii/ */
@@ -365,10 +372,10 @@ typedef void * lv_font_user_data_t;
#define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_RED #define LV_THEME_DEFAULT_COLOR_PRIMARY LV_COLOR_RED
#define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLUE #define LV_THEME_DEFAULT_COLOR_SECONDARY LV_COLOR_BLUE
#define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT #define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT
#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_roboto_16 #define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_roboto_16 #define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_roboto_16 #define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_16
#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_roboto_16 #define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_16
/*================= /*=================
* Text settings * Text settings

Binary file not shown.

Binary file not shown.

View File

@@ -23,7 +23,7 @@ parser.add_argument('-r', '--range',
parser.add_argument('--font', parser.add_argument('--font',
metavar = 'file', metavar = 'file',
nargs='?', nargs='?',
default='Roboto-Regular.woff', default='Montserrat-Medium.ttf',
help='A TTF or WOFF file') help='A TTF or WOFF file')
parser.add_argument('-o', '--output', parser.add_argument('-o', '--output',
nargs='?', nargs='?',
@@ -45,5 +45,5 @@ else:
syms = "61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650" syms = "61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650"
#Run the command (Add degree and bbullet symbol) #Run the command (Add degree and bbullet symbol)
cmd = "lv_font_conv {} --bpp {} --size {} --font Roboto-Regular.woff -r {} --font FontAwesome5-Solid+Brands+Regular.woff -r {} --format lvgl -o {} --force-fast-kern-format".format(compr, args.bpp, args.size, args.range[0], syms, args.output) cmd = "lv_font_conv {} --bpp {} --size {} --font Montserrat-Medium.ttf -r {} --font FontAwesome5-Solid+Brands+Regular.woff -r {} --format lvgl -o {} --force-fast-kern-format".format(compr, args.bpp, args.size, args.range[0], syms, args.output)
os.system(cmd) os.system(cmd)

View File

@@ -1,26 +1,54 @@
import os import os
print("Generating 12 px") print("Generating 12 px")
os.system("python built_in_font_gen.py --size 12 -o lv_font_roboto_12.c --bpp 4") os.system("python built_in_font_gen.py --size 12 -o lv_font_montserrat_12.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_roboto_12.c') os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_12.c')
print("\nGenerating 14 px")
os.system("python built_in_font_gen.py --size 14 -o lv_font_montserrat_14.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_14.c')
print("\nGenerating 16 px") print("\nGenerating 16 px")
os.system("python built_in_font_gen.py --size 16 -o lv_font_roboto_16.c --bpp 4") os.system("python built_in_font_gen.py --size 16 -o lv_font_montserrat_16.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_roboto_16.c') os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_16.c')
print("\nGenerating 18 px")
os.system("python built_in_font_gen.py --size 18 -o lv_font_montserrat_18.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_18.c')
print("\nGenerating 20 px")
os.system("python built_in_font_gen.py --size 20 -o lv_font_montserrat_20.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_20.c')
print("\nGenerating 22 px") print("\nGenerating 22 px")
os.system("python built_in_font_gen.py --size 22 -o lv_font_roboto_22.c --bpp 4") os.system("python built_in_font_gen.py --size 22 -o lv_font_montserrat_22.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_roboto_22.c') os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_22.c')
print("\nGenerating 24 px")
os.system("python built_in_font_gen.py --size 24 -o lv_font_montserrat_24.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_24.c')
print("\nGenerating 26 px")
os.system("python built_in_font_gen.py --size 26 -o lv_font_montserrat_26.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_26.c')
print("\nGenerating 28 px") print("\nGenerating 28 px")
os.system("python built_in_font_gen.py --size 28 -o lv_font_roboto_28.c --bpp 4") os.system("python built_in_font_gen.py --size 28 -o lv_font_montserrat_28.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_roboto_28.c') os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_28.c')
print("\nGenerating 30 px")
os.system("python built_in_font_gen.py --size 30 -o lv_font_montserrat_30.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_30.c')
print("\nGenerating 32 px")
os.system("python built_in_font_gen.py --size 32 -o lv_font_montserrat_32.c --bpp 4")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_32.c')
print("\nGenerating 12 px subpx") print("\nGenerating 12 px subpx")
os.system("python built_in_font_gen.py --size 12 -o lv_font_roboto_12_subpx.c --bpp 4 --subpx") os.system("python built_in_font_gen.py --size 12 -o lv_font_montserrat_12_subpx.c --bpp 4 --subpx")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_roboto_12_subpx.c') os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_12_subpx.c')
print("\nGenerating 28 px compressed") print("\nGenerating 28 px compressed")
os.system("python built_in_font_gen.py --size 28 -o lv_font_roboto_28_compressed.c --bpp 4 --compressed") os.system("python built_in_font_gen.py --size 28 -o lv_font_montserrat_28_compressed.c --bpp 4 --compressed")
os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_roboto_28_compressed.c') os.system('sed -i \'s|#include "lvgl/lvgl.h"|#include "../../lvgl.h"|\' lv_font_montserrat_28_compressed.c')

View File

@@ -441,27 +441,48 @@
* To create a new font go to: https://littlevgl.com/ttf-font-to-c-array * To create a new font go to: https://littlevgl.com/ttf-font-to-c-array
*/ */
/* Robot fonts with bpp = 4 /* Montserrat fonts with bpp = 4
* https://fonts.google.com/specimen/Roboto */ * https://fonts.google.com/specimen/Montserrat */
#ifndef LV_FONT_ROBOTO_12 #ifndef LV_FONT_MONTSERRAT_12
#define LV_FONT_ROBOTO_12 0 #define LV_FONT_MONTSERRAT_12 0
#endif #endif
#ifndef LV_FONT_ROBOTO_16 #ifndef LV_FONT_MONTSERRAT_14
#define LV_FONT_ROBOTO_16 1 #define LV_FONT_MONTSERRAT_14 0
#endif #endif
#ifndef LV_FONT_ROBOTO_22 #ifndef LV_FONT_MONTSERRAT_16
#define LV_FONT_ROBOTO_22 0 #define LV_FONT_MONTSERRAT_16 1
#endif #endif
#ifndef LV_FONT_ROBOTO_28 #ifndef LV_FONT_MONTSERRAT_18
#define LV_FONT_ROBOTO_28 0 #define LV_FONT_MONTSERRAT_18 0
#endif
#ifndef LV_FONT_MONTSERRAT_20
#define LV_FONT_MONTSERRAT_20 0
#endif
#ifndef LV_FONT_MONTSERRAT_22
#define LV_FONT_MONTSERRAT_22 0
#endif
#ifndef LV_FONT_MONTSERRAT_24
#define LV_FONT_MONTSERRAT_24 0
#endif
#ifndef LV_FONT_MONTSERRAT_26
#define LV_FONT_MONTSERRAT_26 0
#endif
#ifndef LV_FONT_MONTSERRAT_28
#define LV_FONT_MONTSERRAT_28 0
#endif
#ifndef LV_FONT_MONTSERRAT_30
#define LV_FONT_MONTSERRAT_30 0
#endif
#ifndef LV_FONT_MONTSERRAT_32
#define LV_FONT_MONTSERRAT_32 0
#endif #endif
/* Demonstrate special features */ /* Demonstrate special features */
#ifndef LV_FONT_ROBOTO_12_SUBPX #ifndef LV_FONT_MONTSERRAT_12_SUBPX
#define LV_FONT_ROBOTO_12_SUBPX 1 #define LV_FONT_MONTSERRAT_12_SUBPX 0
#endif #endif
#ifndef LV_FONT_ROBOTO_28_COMPRESSED #ifndef LV_FONT_MONTSERRAT_28_COMPRESSED
#define LV_FONT_ROBOTO_28_COMPRESSED 1 /*bpp = 3*/ #define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
#endif #endif
/*Pixel perfect monospace font /*Pixel perfect monospace font
@@ -525,16 +546,16 @@
#define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT #define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT
#endif #endif
#ifndef LV_THEME_DEFAULT_FONT_SMALL #ifndef LV_THEME_DEFAULT_FONT_SMALL
#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_roboto_16 #define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_16
#endif #endif
#ifndef LV_THEME_DEFAULT_FONT_NORMAL #ifndef LV_THEME_DEFAULT_FONT_NORMAL
#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_roboto_16 #define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16
#endif #endif
#ifndef LV_THEME_DEFAULT_FONT_SUBTITLE #ifndef LV_THEME_DEFAULT_FONT_SUBTITLE
#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_roboto_16 #define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_16
#endif #endif
#ifndef LV_THEME_DEFAULT_FONT_TITLE #ifndef LV_THEME_DEFAULT_FONT_TITLE
#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_roboto_16 #define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_16
#endif #endif
/*================= /*=================

View File

@@ -879,6 +879,22 @@ static lv_draw_mask_res_t lv_draw_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs
} }
} }
static inline void sqrt_approx(lv_sqrt_res_t * q, lv_sqrt_res_t * ref, uint32_t x)
{
x = x << 8;
uint32_t raw = (ref->i << 4) + (ref->f >> 4);
uint32_t raw2 = raw*raw;
int32_t d = x -raw2;
d = (int32_t)d / (int32_t)(2 * raw) + raw;
q->i = d >> 4;
q->f = (d & 0xF) << 4;
}
static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len, static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len,
lv_draw_mask_radius_param_t * p) lv_draw_mask_radius_param_t * p)
{ {
@@ -1083,7 +1099,10 @@ static lv_draw_mask_res_t lv_draw_mask_radius(lv_opa_t * mask_buf, lv_coord_t ab
/*Set all points which are crossed by the circle*/ /*Set all points which are crossed by the circle*/
for(; i <= x1.i; i++) { for(; i <= x1.i; i++) {
lv_sqrt(r2 - (i * i), &y_next, sqrt_mask);
sqrt_approx(&y_next, &y_prev, r2 - (i * i));
// lv_sqrt(r2 - (i * i), &y_next, sqrt_mask);
m = (y_prev.f + y_next.f) >> 1; m = (y_prev.f + y_next.f) >> 1;
if(outer) m = 255 - m; if(outer) m = 255 - m;
@@ -1212,15 +1231,3 @@ static inline lv_opa_t mask_mix(lv_opa_t mask_act, lv_opa_t mask_new)
return (int32_t)((int32_t)(mask_act * mask_new) >> 8); return (int32_t)((int32_t)(mask_act * mask_new) >> 8);
} }
static inline sqrt_approx(lv_sqrt_res_t * q, lv_sqrt_res_t * ref, uint32_t x)
{
uint32_t raw = (ref->i << 4) + (ref->f >> 4);
}

View File

@@ -127,20 +127,56 @@ static inline lv_coord_t lv_font_get_line_height(const lv_font_t * font_p)
#define LV_FONT_DECLARE(font_name) extern lv_font_t font_name; #define LV_FONT_DECLARE(font_name) extern lv_font_t font_name;
#if LV_FONT_ROBOTO_12 #if LV_FONT_MONTSERRAT_12
LV_FONT_DECLARE(lv_font_roboto_12) LV_FONT_DECLARE(lv_font_montserrat_12)
#endif #endif
#if LV_FONT_ROBOTO_16 #if LV_FONT_MONTSERRAT_14
LV_FONT_DECLARE(lv_font_roboto_16) LV_FONT_DECLARE(lv_font_montserrat_14)
#endif #endif
#if LV_FONT_ROBOTO_22 #if LV_FONT_MONTSERRAT_16
LV_FONT_DECLARE(lv_font_roboto_22) LV_FONT_DECLARE(lv_font_montserrat_16)
#endif #endif
#if LV_FONT_ROBOTO_28 #if LV_FONT_MONTSERRAT_18
LV_FONT_DECLARE(lv_font_roboto_28) LV_FONT_DECLARE(lv_font_montserrat_18)
#endif
#if LV_FONT_MONTSERRAT_20
LV_FONT_DECLARE(lv_font_montserrat_20)
#endif
#if LV_FONT_MONTSERRAT_22
LV_FONT_DECLARE(lv_font_montserrat_22)
#endif
#if LV_FONT_MONTSERRAT_24
LV_FONT_DECLARE(lv_font_montserrat_24)
#endif
#if LV_FONT_MONTSERRAT_26
LV_FONT_DECLARE(lv_font_montserrat_26)
#endif
#if LV_FONT_MONTSERRAT_28
LV_FONT_DECLARE(lv_font_montserrat_28)
#endif
#if LV_FONT_MONTSERRAT_30
LV_FONT_DECLARE(lv_font_montserrat_30)
#endif
#if LV_FONT_MONTSERRAT_32
LV_FONT_DECLARE(lv_font_montserrat_32)
#endif
#if LV_FONT_MONTSERRAT_28_COMPRESSED
LV_FONT_DECLARE(lv_font_montserrat_28_compressed)
#endif
#if LV_FONT_MONTSERRAT_12_SUBPX
LV_FONT_DECLARE(lv_font_montserrat_12_subpx)
#endif #endif
#if LV_FONT_UNSCII_8 #if LV_FONT_UNSCII_8

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -136,6 +136,10 @@ static lv_style_t pad_small;
static lv_style_t list_bg, list_btn; static lv_style_t list_bg, list_btn;
#endif #endif
#if LV_USE_MSGBOX
static lv_style_t mbox_bg;
#endif
#if LV_USE_PAGE #if LV_USE_PAGE
static lv_style_t sb; static lv_style_t sb;
#endif #endif
@@ -495,7 +499,7 @@ static void chart_init(void)
lv_style_init(&chart_series); lv_style_init(&chart_series);
lv_style_set_line_width(&chart_series, LV_STATE_DEFAULT, LV_DPI / 50); lv_style_set_line_width(&chart_series, LV_STATE_DEFAULT, LV_DPI / 50);
lv_style_set_size(&chart_series, LV_STATE_DEFAULT, LV_DPI / 40); lv_style_set_size(&chart_series, LV_STATE_DEFAULT, LV_DPI / 40);
lv_style_set_pad_inner(&chart_series, LV_STATE_DEFAULT, 2); /*Space between columns*/ lv_style_set_pad_inner(&chart_series, LV_STATE_DEFAULT, LV_MATH_MAX(LV_DPI / 100, 1)); /*Space between columns*/
lv_style_set_radius(&chart_series, LV_STATE_DEFAULT, 1); lv_style_set_radius(&chart_series, LV_STATE_DEFAULT, 1);
#endif #endif
@@ -531,7 +535,7 @@ static void calendar_init(void)
lv_style_set_border_width(&calendar_date_nums, LV_STATE_CHECKED, 2); lv_style_set_border_width(&calendar_date_nums, LV_STATE_CHECKED, 2);
lv_style_set_border_side(&calendar_date_nums, LV_STATE_CHECKED, LV_BORDER_SIDE_LEFT); lv_style_set_border_side(&calendar_date_nums, LV_STATE_CHECKED, LV_BORDER_SIDE_LEFT);
lv_style_set_border_color(&calendar_date_nums, LV_STATE_CHECKED, theme.color_primary); lv_style_set_border_color(&calendar_date_nums, LV_STATE_CHECKED, theme.color_primary);
lv_style_set_pad_inner(&calendar_date_nums, LV_STATE_DEFAULT, LV_DPI / 40); lv_style_set_pad_inner(&calendar_date_nums, LV_STATE_DEFAULT, LV_MATH_MAX(LV_DPI / 50, 1));
lv_style_set_pad_left(&calendar_date_nums, LV_STATE_DEFAULT, LV_DPI / 9); lv_style_set_pad_left(&calendar_date_nums, LV_STATE_DEFAULT, LV_DPI / 9);
lv_style_set_pad_right(&calendar_date_nums, LV_STATE_DEFAULT, LV_DPI / 9); lv_style_set_pad_right(&calendar_date_nums, LV_STATE_DEFAULT, LV_DPI / 9);
lv_style_set_pad_bottom(&calendar_date_nums, LV_STATE_DEFAULT, LV_DPI / 9); lv_style_set_pad_bottom(&calendar_date_nums, LV_STATE_DEFAULT, LV_DPI / 9);
@@ -609,6 +613,9 @@ static void keyboard_init(void)
static void msgbox_init(void) static void msgbox_init(void)
{ {
#if LV_USE_MSGBOX #if LV_USE_MSGBOX
lv_style_init(&mbox_bg);
lv_style_set_shadow_width(&mbox_bg, LV_STATE_DEFAULT, LV_DPI / 4);
lv_style_set_shadow_color(&mbox_bg, LV_STATE_DEFAULT, LV_COLOR_SILVER);
#endif #endif
} }
@@ -618,11 +625,11 @@ static void page_init(void)
#if LV_USE_PAGE #if LV_USE_PAGE
lv_style_init(&sb); lv_style_init(&sb);
lv_style_set_bg_opa(&sb, LV_STATE_DEFAULT, LV_OPA_COVER); lv_style_set_bg_opa(&sb, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&sb, LV_STATE_DEFAULT, COLOR_BG_BORDER); lv_style_set_bg_color(&sb, LV_STATE_DEFAULT, (IS_LIGHT ? lv_color_hex(0xcccfd1) : lv_color_hex(0x505559)));
lv_style_set_radius(&sb, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE); lv_style_set_radius(&sb, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
lv_style_set_size(&sb, LV_STATE_DEFAULT, LV_DPI / 30); lv_style_set_size(&sb, LV_STATE_DEFAULT, LV_DPI / 30);
lv_style_set_pad_right(&sb, LV_STATE_DEFAULT, LV_DPI / 20); lv_style_set_pad_right(&sb, LV_STATE_DEFAULT, LV_DPI / 30);
lv_style_set_pad_bottom(&sb, LV_STATE_DEFAULT, LV_DPI / 20); lv_style_set_pad_bottom(&sb, LV_STATE_DEFAULT, LV_DPI / 30);
#endif #endif
} }
@@ -659,6 +666,7 @@ static void list_init(void)
{ {
#if LV_USE_LIST != 0 #if LV_USE_LIST != 0
lv_style_init(&list_bg); lv_style_init(&list_bg);
lv_style_set_clip_corner(&list_bg, LV_STATE_DEFAULT, true);
lv_style_set_pad_left(&list_bg, LV_STATE_DEFAULT, 0); lv_style_set_pad_left(&list_bg, LV_STATE_DEFAULT, 0);
lv_style_set_pad_right(&list_bg, LV_STATE_DEFAULT, 0); lv_style_set_pad_right(&list_bg, LV_STATE_DEFAULT, 0);
lv_style_set_pad_top(&list_bg, LV_STATE_DEFAULT, 0); lv_style_set_pad_top(&list_bg, LV_STATE_DEFAULT, 0);
@@ -738,25 +746,26 @@ static void tabview_init(void)
lv_style_set_bg_color(&tabview_btns_bg, LV_STATE_DEFAULT, COLOR_BG); lv_style_set_bg_color(&tabview_btns_bg, LV_STATE_DEFAULT, COLOR_BG);
lv_style_set_border_color(&tabview_btns_bg, LV_STATE_DEFAULT, lv_style_set_border_color(&tabview_btns_bg, LV_STATE_DEFAULT,
IS_LIGHT ? lv_color_hex(0xe4eaf0) : lv_color_hex(0x3b3e42)); IS_LIGHT ? lv_color_hex(0xe4eaf0) : lv_color_hex(0x3b3e42));
lv_style_set_border_width(&tabview_btns_bg, LV_STATE_DEFAULT, LV_DPI / 30 > 0 ? LV_DPI / 30 : 1); lv_style_set_border_width(&tabview_btns_bg, LV_STATE_DEFAULT, LV_DPI / 40 > 0 ? LV_DPI / 40 : 1);
lv_style_set_border_side(&tabview_btns_bg, LV_STATE_DEFAULT, LV_BORDER_SIDE_BOTTOM); lv_style_set_border_side(&tabview_btns_bg, LV_STATE_DEFAULT, LV_BORDER_SIDE_BOTTOM);
lv_style_set_text_color(&tabview_btns_bg, LV_STATE_DEFAULT, COLOR_SCR_TEXT); lv_style_set_text_color(&tabview_btns_bg, LV_STATE_DEFAULT, COLOR_SCR_TEXT);
lv_style_set_text_font(&tabview_btns_bg, LV_STATE_DEFAULT, theme.font_normal); lv_style_set_text_font(&tabview_btns_bg, LV_STATE_DEFAULT, theme.font_normal);
lv_style_set_image_recolor(&tabview_btns_bg, LV_STATE_DEFAULT, lv_color_hex(0x979a9f)); lv_style_set_image_recolor(&tabview_btns_bg, LV_STATE_DEFAULT, lv_color_hex(0x979a9f));
lv_style_set_pad_top(&tabview_btns_bg, LV_STATE_DEFAULT, LV_DPI / 7); lv_style_set_pad_top(&tabview_btns_bg, LV_STATE_DEFAULT, LV_DPI / 30);
lv_style_set_pad_left(&tabview_btns_bg, LV_STATE_DEFAULT, LV_DPI / 30);
lv_style_set_pad_right(&tabview_btns_bg, LV_STATE_DEFAULT, LV_DPI / 30);
lv_style_init(&tabview_btns); lv_style_init(&tabview_btns);
lv_style_set_bg_opa(&tabview_btns, LV_STATE_PRESSED, LV_OPA_50); lv_style_set_bg_opa(&tabview_btns, LV_STATE_PRESSED, LV_OPA_50);
lv_style_set_bg_color(&tabview_btns, LV_STATE_PRESSED, lv_color_hex3(0x888)); lv_style_set_bg_color(&tabview_btns, LV_STATE_PRESSED, lv_color_hex3(0x888));
lv_style_set_text_color(&tabview_btns, LV_STATE_CHECKED, COLOR_SCR_TEXT); lv_style_set_text_color(&tabview_btns, LV_STATE_CHECKED, COLOR_SCR_TEXT);
lv_style_set_pad_top(&tabview_btns, LV_STATE_DEFAULT, LV_DPI / 7); lv_style_set_pad_top(&tabview_btns, LV_STATE_DEFAULT, LV_DPI / 10);
lv_style_set_pad_bottom(&tabview_btns, LV_STATE_DEFAULT, LV_DPI / 7); lv_style_set_pad_bottom(&tabview_btns, LV_STATE_DEFAULT, LV_DPI / 10);
lv_style_init(&tabview_indic); lv_style_init(&tabview_indic);
lv_style_set_bg_opa(&tabview_indic, LV_STATE_DEFAULT, LV_OPA_COVER); lv_style_set_bg_opa(&tabview_indic, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&tabview_indic, LV_STATE_DEFAULT, theme.color_primary); lv_style_set_bg_color(&tabview_indic, LV_STATE_DEFAULT, theme.color_primary);
lv_style_set_size(&tabview_indic, LV_STATE_DEFAULT, LV_DPI / 25 > 0 ? LV_DPI / 25 : 1); lv_style_set_size(&tabview_indic, LV_STATE_DEFAULT, LV_DPI / 40 > 0 ? LV_DPI / 40 : 1);
lv_style_set_radius(&tabview_indic, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE); lv_style_set_radius(&tabview_indic, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
@@ -1044,6 +1053,7 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BG); lv_obj_clean_style_list(obj, LV_MSGBOX_PART_BG);
list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BG); list = lv_obj_get_style_list(obj, LV_MSGBOX_PART_BG);
lv_style_list_add_style(list, &bg); lv_style_list_add_style(list, &bg);
lv_style_list_add_style(list, &mbox_bg);
break; break;
case LV_THEME_MSGBOX_BTNS: case LV_THEME_MSGBOX_BTNS:
@@ -1202,6 +1212,7 @@ void lv_theme_material_apply(lv_obj_t * obj, lv_theme_style_t name)
lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES_BG); lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES_BG);
list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES_BG); list = lv_obj_get_style_list(obj, LV_CHART_PART_SERIES_BG);
lv_style_list_add_style(list, &pad_small);
lv_style_list_add_style(list, &chart_series_bg); lv_style_list_add_style(list, &chart_series_bg);
lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES); lv_obj_clean_style_list(obj, LV_CHART_PART_SERIES);

View File

@@ -490,7 +490,7 @@ void lv_theme_mono_apply(lv_obj_t * obj, lv_theme_style_t name)
lv_style_list_add_style(list, &style_bg); lv_style_list_add_style(list, &style_bg);
lv_style_list_add_style(list, &style_border_none); lv_style_list_add_style(list, &style_border_none);
lv_style_list_add_style(list, &style_no_radius); lv_style_list_add_style(list, &style_no_radius);
// lv_style_list_add_style(list, &style_pad_none); lv_style_list_add_style(list, &style_pad_none);
break; break;
case LV_THEME_OBJ: case LV_THEME_OBJ:
lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN); lv_obj_clean_style_list(obj, LV_OBJ_PART_MAIN);

View File

@@ -19,7 +19,6 @@
* DEFINES * DEFINES
*********************/ *********************/
#define LV_OBJX_NAME "lv_linemeter" #define LV_OBJX_NAME "lv_linemeter"
#define LV_LINEMETER_PRECISE 0 /*Draw line more precisely at cost of performance*/
/********************** /**********************
* TYPEDEFS * TYPEDEFS