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
b73efc27
Commit
b73efc27
authored
Jan 06, 2017
by
Gabor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_objx: minor fixes
parent
488ba95a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
16 deletions
+25
-16
lv_cb.c
lv_objx/lv_cb.c
+20
-10
lv_mbox.c
lv_objx/lv_mbox.c
+3
-5
lv_rect.c
lv_objx/lv_rect.c
+2
-1
No files found.
lv_objx/lv_cb.c
View file @
b73efc27
...
...
@@ -22,16 +22,14 @@
/**********************
* STATIC PROTOTYPES
**********************/
#if 0 /*The ancestor design function is used */
static
bool
lv_cb_design
(
lv_obj_t
*
cb
,
const
area_t
*
mask
,
lv_design_mode_t
mode
);
#endif
static
void
lv_cbs_init
(
void
);
/**********************
* STATIC VARIABLES
**********************/
static
lv_cbs_t
lv_cbs_def
;
static
lv_design_f_t
ancestor_design_f
;
/**********************
* MACROS
**********************/
...
...
@@ -61,7 +59,10 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
ext
->
bullet
=
NULL
;
ext
->
label
=
NULL
;
if
(
ancestor_design_f
==
NULL
)
ancestor_design_f
=
lv_obj_get_design_f
(
new_cb
);
lv_obj_set_signal_f
(
new_cb
,
lv_cb_signal
);
lv_obj_set_design_f
(
new_cb
,
lv_cb_design
);
/*Init the new checkbox object*/
if
(
copy
==
NULL
)
{
...
...
@@ -207,7 +208,6 @@ lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy)
* STATIC FUNCTIONS
**********************/
#if 0 /*The ancestor design function is used */
/**
* Handle the drawing related tasks of the check boxes
* @param cb pointer to an object
...
...
@@ -222,14 +222,23 @@ static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mo
{
if
(
mode
==
LV_DESIGN_COVER_CHK
)
{
/*Return false if the object is not covers the mask_p area*/
return false;
return
ancestor_design_f
(
cb
,
mask
,
mode
);
}
else
if
(
mode
==
LV_DESIGN_DRAW_MAIN
||
mode
==
LV_DESIGN_DRAW_POST
)
{
lv_cb_ext_t
*
cb_ext
=
lv_obj_get_ext
(
cb
);
lv_btn_ext_t
*
bullet_ext
=
lv_obj_get_ext
(
cb_ext
->
bullet
);
/*Be sure he state of the bullet is the same as the parent button*/
bullet_ext
->
state
=
cb_ext
->
bg_btn
.
state
;
return
ancestor_design_f
(
cb
,
mask
,
mode
);
}
/*Draw the object*/
return
true
;
}
#endif
/**
* Initialize the rectangle styles
*/
...
...
@@ -239,8 +248,8 @@ static void lv_cbs_init(void)
/*Bg style*/
lv_btns_get
(
LV_RECTS_TRANSP
,
&
lv_cbs_def
.
bg
);
lv_cbs_def
.
bg
.
rects
.
hpad
=
0
*
LV_DOWNSCALE
;
lv_cbs_def
.
bg
.
rects
.
vpad
=
0
*
LV_DOWNSCALE
;
lv_cbs_def
.
bg
.
rects
.
hpad
=
6
*
LV_DOWNSCALE
;
lv_cbs_def
.
bg
.
rects
.
vpad
=
6
*
LV_DOWNSCALE
;
lv_cbs_def
.
bg
.
rects
.
opad
=
5
*
LV_DOWNSCALE
;
/*Bullet style*/
...
...
@@ -259,12 +268,12 @@ static void lv_cbs_init(void)
lv_cbs_def
.
bullet
.
mcolor
[
LV_BTN_STATE_TGL_REL
]
=
COLOR_MAKE
(
0x20
,
0x30
,
0x40
);
lv_cbs_def
.
bullet
.
gcolor
[
LV_BTN_STATE_TGL_REL
]
=
COLOR_MAKE
(
0x10
,
0x20
,
0x30
);
lv_cbs_def
.
bullet
.
bcolor
[
LV_BTN_STATE_TGL_REL
]
=
COLOR_WHITE
;
lv_cbs_def
.
bullet
.
flags
[
LV_BTN_STATE_TGL_REL
].
light_en
=
0
;
lv_cbs_def
.
bullet
.
flags
[
LV_BTN_STATE_TGL_REL
].
light_en
=
1
;
lv_cbs_def
.
bullet
.
mcolor
[
LV_BTN_STATE_TGL_PR
]
=
COLOR_MAKE
(
0x50
,
0x70
,
0x90
);
lv_cbs_def
.
bullet
.
gcolor
[
LV_BTN_STATE_TGL_PR
]
=
COLOR_MAKE
(
0x20
,
0x30
,
0x40
);
lv_cbs_def
.
bullet
.
bcolor
[
LV_BTN_STATE_TGL_PR
]
=
COLOR_WHITE
;
lv_cbs_def
.
bullet
.
flags
[
LV_BTN_STATE_TGL_PR
].
light_en
=
0
;
lv_cbs_def
.
bullet
.
flags
[
LV_BTN_STATE_TGL_PR
].
light_en
=
1
;
lv_cbs_def
.
bullet
.
mcolor
[
LV_BTN_STATE_INA
]
=
COLOR_SILVER
;
lv_cbs_def
.
bullet
.
gcolor
[
LV_BTN_STATE_INA
]
=
COLOR_GRAY
;
...
...
@@ -273,6 +282,7 @@ static void lv_cbs_init(void)
lv_cbs_def
.
bullet
.
rects
.
bwidth
=
2
*
LV_DOWNSCALE
;
lv_cbs_def
.
bullet
.
rects
.
bopa
=
70
;
lv_cbs_def
.
bullet
.
rects
.
light
=
6
*
LV_DOWNSCALE
;
lv_cbs_def
.
bullet
.
rects
.
empty
=
0
;
lv_cbs_def
.
bullet
.
rects
.
round
=
LV_OBJ_DEF_WIDTH
/
3
/
4
;
lv_cbs_def
.
bullet
.
rects
.
hpad
=
0
*
LV_DOWNSCALE
;
...
...
lv_objx/lv_mbox.c
View file @
b73efc27
...
...
@@ -27,7 +27,7 @@
#if 0 /*Unused*/
static bool lv_mbox_design(lv_obj_t * mbox, const area_t * mask, lv_design_mode_t mode);
#endif
static
void
lv_
temp
s_init
(
void
);
static
void
lv_
mbox
s_init
(
void
);
static
void
lv_mbox_realign
(
lv_obj_t
*
mbox
);
/**********************
...
...
@@ -318,7 +318,7 @@ lv_mboxs_t * lv_mboxs_get(lv_mboxs_builtin_t style, lv_mboxs_t * copy)
/*Make the style initialization if it is not done yet*/
if
(
style_inited
==
false
)
{
lv_
temp
s_init
();
lv_
mbox
s_init
();
style_inited
=
true
;
}
...
...
@@ -378,7 +378,7 @@ static bool lv_mbox_design(lv_obj_t * mbox, const area_t * mask, lv_design_mode_
/**
* Initialize the message box styles
*/
static
void
lv_
temp
s_init
(
void
)
static
void
lv_
mbox
s_init
(
void
)
{
/*Default style*/
lv_rects_get
(
LV_RECTS_DEF
,
&
lv_mboxs_def
.
bg
);
...
...
@@ -417,6 +417,4 @@ static void lv_mbox_realign(lv_obj_t * mbox)
lv_obj_align
(
mbox
,
NULL
,
LV_ALIGN_CENTER
,
0
,
0
);
}
#endif
lv_objx/lv_rect.c
View file @
b73efc27
...
...
@@ -345,7 +345,7 @@ static void lv_rect_draw_light(lv_obj_t * rect, const area_t * mask)
light_style
.
empty
=
1
;
light_style
.
bwidth
=
light_size
;
light_style
.
round
=
style
->
round
+
light_size
;
light_style
.
round
=
style
->
round
+
light_size
+
1
;
light_style
.
bcolor
=
style
->
lcolor
;
light_style
.
bopa
=
100
;
...
...
@@ -411,6 +411,7 @@ static void lv_rect_layout_col(lv_obj_t * rect)
switch
(
type
)
{
case
LV_RECT_LAYOUT_COL_L
:
hpad_corr
=
style
->
hpad
;
align
=
LV_ALIGN_IN_TOP_LEFT
;
break
;
case
LV_RECT_LAYOUT_COL_M
:
...
...
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