BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
925a174a
Commit
925a174a
authored
Dec 21, 2017
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update templates and themes
parent
5654c97c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
128 additions
and
30 deletions
+128
-30
lv_conf_templ.h
lv_conf_templ.h
+20
-17
lv_btn.h
lv_objx/lv_btn.h
+1
-1
lv_ddlist.c
lv_objx/lv_ddlist.c
+0
-1
lv_objx_templ.c
lv_objx/lv_objx_templ.c
+38
-0
lv_objx_templ.h
lv_objx/lv_objx_templ.h
+38
-7
lv_roller.c
lv_objx/lv_roller.c
+9
-0
lv_theme_zen.c
lv_themes/lv_theme_zen.c
+19
-4
lv_themes.mk
lv_themes/lv_themes.mk
+3
-0
No files found.
lv_conf_templ.h
View file @
925a174a
...
...
@@ -27,12 +27,12 @@
*=====================*/
/* Horizontal and vertical resolution of the library.*/
#define LV_HOR_RES
320
#define LV_VER_RES
240
#define LV_HOR_RES
(480)
#define LV_VER_RES
(320)
#define LV_DPI 100
/* Buffered rendering: >= LV_DOWNSCALE * lv_disp_hor_res() or 0 to disable buffering*/
#define LV_VDB_SIZE (20
* 1024
)
#define LV_VDB_SIZE (20
* 1024
)
#define LV_VDB_ADR 0 /*Place VDB to a specific address (e.g. in external RAM) (0: allocate into RAM)*/
/* Use two Virtual Display buffers (VDB) parallelize rendering and flushing
...
...
@@ -73,23 +73,23 @@
#define LV_TXT_UTF8 1
#define LV_TXT_BREAK_CHARS " ,.;:-_" /*Can break texts on these chars*/
/*
F
eature usage*/
/*
Graphics f
eature usage*/
#define USE_LV_ANIMATION 1 /*1: disable all animations*/
#define USE_LV_SHADOW 1 /*1: disable shadows*/
#define USE_LV_GROUP 1 /*1: Enable object groups (for keyboards)*/
#define USE_LV_GPU
1
/*1: Enable GPU interface*/
#define USE_LV_GPU
0
/*1: Enable GPU interface*/
#define USE_LV_FILESYSTEM 1 /*1: Enable file system (required by images aka. lv_img)*/
/*================
==
/*================
* THEME USAGE
*================*/
#define USE_LV_THEME_TEMPL 0 /*Just for test*/
#define USE_LV_THEME_DEFAULT
0
/*Built mainly from the built-in styles. Consumes very few RAM*/
#define USE_LV_THEME_DEFAULT
1
/*Built mainly from the built-in styles. Consumes very few RAM*/
#define USE_LV_THEME_ALIEN 1 /*Dark futuristic theme*/
#define USE_LV_THEME_NIGHT 1 /*Dark elegant theme*/
#define USE_LV_THEME_MONO 1 /*Mono color theme for monochrome displays*/
#define USE_LV_THEME_MATERIAL
0 /*Flat theme with bold colors and light shadows (Planned)
*/
#define USE_LV_THEME_ZEN
0 /*Peaceful, mainly black and white theme (Planned)
*/
#define USE_LV_THEME_MATERIAL
1 /*Flat theme with bold colors and light shadows
*/
#define USE_LV_THEME_ZEN
1 /*Peaceful, mainly light theme
*/
/*==================
* FONT USAGE
...
...
@@ -202,10 +202,10 @@
/*Bar (dependencies: -)*/
#define USE_LV_BAR 1
/*Line meter (dependencies:
bar; misc: trigo
)*/
/*Line meter (dependencies:
*;
)*/
#define USE_LV_LMETER 1
/*Gauge (dependencies:bar, lmeter
; misc: trigo
)*/
/*Gauge (dependencies:bar, lmeter)*/
#define USE_LV_GAUGE 1
/*Chart (dependencies: -)*/
...
...
@@ -220,8 +220,8 @@
/*Text area (dependencies: lv_label, lv_page)*/
#define USE_LV_TA 1
#if USE_LV_TA != 0
#define LV_TA_CURSOR_BLINK_TIME 400 /*ms*/
#define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
#define LV_TA_CURSOR_BLINK_TIME 400
/*ms*/
#define LV_TA_PWD_SHOW_TIME
1500 /*ms*/
#endif
/*************************
...
...
@@ -240,9 +240,6 @@
/*Check box (dependencies: lv_btn, lv_label)*/
#define USE_LV_CB 1
/*Switch (dependencies: lv_slider)*/
#define USE_LV_SW 1
/*List (dependencies: lv_page, lv_btn, lv_label, (lv_img optionally for icons ))*/
#define USE_LV_LIST 1
#if USE_LV_LIST != 0
...
...
@@ -255,12 +252,18 @@
#define LV_DDLIST_ANIM_TIME 200 /*Open and close default animation time [ms] (0: no animation)*/
#endif
/*
Drop down list
(dependencies: lv_ddlist)*/
/*
Roller
(dependencies: lv_ddlist)*/
#define USE_LV_ROLLER 1
#if USE_LV_ROLLER != 0
#define LV_ROLLER_ANIM_TIME 200 /*Focus animation time [ms] (0: no animation)*/
#endif
/*Slider (dependencies: lv_bar)*/
#define USE_LV_SLIDER 1
/*Switch (dependencies: lv_slider)*/
#define USE_LV_SW 1
#endif /*LV_CONF_H*/
#endif
/*Remove this to enable the content*/
...
...
lv_objx/lv_btn.h
View file @
925a174a
...
...
@@ -65,6 +65,7 @@ typedef struct
uint8_t
long_pr_action_executed
:
1
;
/*1: Long press action executed (Handled by the library)*/
}
lv_btn_ext_t
;
/*Styles*/
typedef
enum
{
LV_BTN_STYLE_REL
,
LV_BTN_STYLE_PR
,
...
...
@@ -138,7 +139,6 @@ static inline void lv_btn_set_fit(lv_obj_t * btn, bool hor_en, bool ver_en)
lv_cont_set_fit
(
btn
,
hor_en
,
ver_en
);
}
/**
* Set a style of a button.
* @param btn pointer to button object
...
...
lv_objx/lv_ddlist.c
View file @
925a174a
...
...
@@ -21,7 +21,6 @@
/*********************
* DEFINES
*********************/
#if USE_LV_ANIMATION
# ifndef LV_DDLIST_ANIM_TIME
# define LV_DDLIST_ANIM_TIME 200
/*ms*/
...
...
lv_objx/lv_objx_templ.c
View file @
925a174a
...
...
@@ -105,6 +105,24 @@ lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy)
*/
/**
* Set a style of a template.
* @param templ pointer to template object
* @param type which style should be set
* @param style pointer to a style
* */
void
lv_templ_set_style
(
lv_obj_t
*
templ
,
lv_templ_style_t
type
,
lv_style_t
*
style
)
{
lv_templ_ext_t
*
ext
=
lv_obj_get_ext_attr
(
templ
);
switch
(
type
)
{
case
LV_TEMPL_STYLE_X
:
break
;
case
LV_TEMPL_STYLE_Y
:
break
;
}
}
/*=====================
* Getter functions
*====================*/
...
...
@@ -113,6 +131,26 @@ lv_obj_t * lv_templ_create(lv_obj_t * par, lv_obj_t * copy)
* New object specific "get" functions come here
*/
/**
* Get style of a template.
* @param templ pointer to template object
* @param type which style should be get
* @return style pointer to the style
* */
lv_style_t
*
lv_btn_get_style
(
lv_obj_t
*
templ
,
lv_templ_style_t
type
)
{
lv_templ_ext_t
*
ext
=
lv_obj_get_ext_attr
(
templ
);
switch
(
type
)
{
case
LV_TEMPL_STYLE_X
:
return
NULL
;
case
LV_TEMPL_STYLE_Y
:
return
NULL
;
default:
return
NULL
;
}
/*To avoid warning*/
return
NULL
;
}
/*=====================
* Other functions
*====================*/
...
...
lv_objx/lv_objx_templ.h
View file @
925a174a
...
...
@@ -39,6 +39,14 @@ typedef struct {
/*New data for this type */
}
lv_templ_ext_t
;
/*Styles*/
typedef
enum
{
LV_TEMPL_STYLE_X
,
LV_TEMPL_STYLE_Y
,
}
lv_templ_style_t
;
/**********************
* GLOBAL PROTOTYPES
**********************/
...
...
@@ -51,15 +59,38 @@ typedef struct {
*/
lv_obj_t
*
lv_templ_create
(
lv_obj_t
*
par
,
lv_obj_t
*
copy
);
/*======================
* Add/remove functions
*=====================*/
/*=====================
* Setter functions
*====================*/
/**
* Signal function of the template
* @param templ pointer to a template object
* @param sign a signal type from lv_signal_t enum
* @param param pointer to a signal specific variable
* @return true: the object is still valid (not deleted), false: the object become invalid
*/
bool
lv_templ_signal
(
lv_obj_t
*
templ
,
lv_signal_t
sign
,
void
*
param
);
* Set a style of a template.
* @param templ pointer to template object
* @param type which style should be set
* @param style pointer to a style
* */
void
lv_templ_set_style
(
lv_obj_t
*
templ
,
lv_templ_style_t
type
,
lv_style_t
*
style
);
/*=====================
* Getter functions
*====================*/
/**
* Get style of a template.
* @param templ pointer to template object
* @param type which style should be get
* @return style pointer to the style
* */
lv_style_t
*
lv_btn_get_style
(
lv_obj_t
*
templ
,
lv_templ_style_t
type
);
/*=====================
* Other functions
*====================*/
/**********************
* MACROS
...
...
lv_objx/lv_roller.c
View file @
925a174a
...
...
@@ -17,6 +17,14 @@
/*********************
* DEFINES
*********************/
#if USE_LV_ANIMATION
# ifndef LV_ROLLER_ANIM_TIME
# define LV_ROLLER_ANIM_TIME 200
/*ms*/
# endif
#else
# undef LV_ROLLER_ANIM_TIME
# define LV_ROLLER_ANIM_TIME 0
/*No animation*/
#endif
/**********************
* TYPEDEFS
...
...
@@ -74,6 +82,7 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, lv_obj_t * copy)
lv_page_set_rel_action
(
new_roller
,
NULL
);
/*Roller don't uses it (like ddlist)*/
lv_page_set_scrl_fit
(
new_roller
,
true
,
false
);
/*Height is specified directly*/
lv_ddlist_open
(
new_roller
,
false
);
lv_ddlist_set_anim_time
(
new_roller
,
LV_ROLLER_ANIM_TIME
);
lv_roller_set_visible_row_count
(
new_roller
,
3
);
lv_label_set_align
(
ext
->
ddlist
.
label
,
LV_LABEL_ALIGN_CENTER
);
...
...
lv_themes/lv_theme_zen.c
View file @
925a174a
...
...
@@ -71,6 +71,13 @@ static void basic_init(void)
panel
.
body
.
padding
.
ver
=
LV_DPI
/
8
;
panel
.
body
.
padding
.
inner
=
LV_DPI
/
10
;
lv_style_copy
(
&
sb
,
&
def
);
sb
.
body
.
main_color
=
lv_color_hsv_to_rgb
(
_hue
,
30
,
90
);
sb
.
body
.
grad_color
=
sb
.
body
.
main_color
;
sb
.
body
.
border
.
width
=
0
;
sb
.
body
.
radius
=
LV_RADIUS_CIRCLE
;
sb
.
body
.
padding
.
inner
=
LV_DPI
/
10
;
theme
.
bg
=
&
bg
;
theme
.
panel
=
&
panel
;
}
...
...
@@ -176,10 +183,10 @@ static void led_init(void)
led
.
body
.
radius
=
LV_RADIUS_CIRCLE
;
led
.
body
.
border
.
width
=
LV_DPI
/
30
;
led
.
body
.
border
.
opa
=
LV_OPA_30
;
led
.
body
.
main_color
=
lv_color_hsv_to_rgb
(
_hue
,
10
0
,
100
);
led
.
body
.
grad_color
=
lv_color_hsv_to_rgb
(
_hue
,
10
0
,
40
);
led
.
body
.
main_color
=
lv_color_hsv_to_rgb
(
_hue
,
6
0
,
100
);
led
.
body
.
grad_color
=
lv_color_hsv_to_rgb
(
_hue
,
6
0
,
40
);
led
.
body
.
border
.
color
=
lv_color_hsv_to_rgb
(
_hue
,
60
,
60
);
led
.
body
.
shadow
.
color
=
lv_color_hsv_to_rgb
(
_hue
,
10
0
,
100
);
led
.
body
.
shadow
.
color
=
lv_color_hsv_to_rgb
(
_hue
,
8
0
,
100
);
theme
.
led
=
&
led
;
#endif
...
...
@@ -272,9 +279,17 @@ static void lmeter_init(void)
static
void
gauge_init
(
void
)
{
#if USE_LV_GAUGE != 0
static
lv_style_t
gauge
;
lv_style_copy
(
&
gauge
,
&
def
);
gauge
.
line
.
color
=
lv_color_hsv_to_rgb
(
_hue
,
50
,
70
);
gauge
.
line
.
width
=
3
;
gauge
.
body
.
main_color
=
LV_COLOR_HEX3
(
0x999
);
gauge
.
body
.
grad_color
=
gauge
.
body
.
main_color
;
gauge
.
body
.
padding
.
hor
=
LV_DPI
/
6
;
gauge
.
body
.
border
.
color
=
LV_COLOR_HEX3
(
0x666
);
/*Needle middle color*/
theme
.
gauge
=
&
def
;
theme
.
gauge
=
&
gauge
;
#endif
}
...
...
lv_themes/lv_themes.mk
View file @
925a174a
...
...
@@ -3,6 +3,9 @@ CSRCS += lv_theme.c
CSRCS += lv_theme_default.c
CSRCS += lv_theme_night.c
CSRCS += lv_theme_templ.c
CSRCS += lv_theme_zen.c
CSRCS += lv_theme_material.c
DEPPATH += --dep-path lvgl/lv_themes
VPATH += :lvgl/lv_themes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment