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
320a5b52
Commit
320a5b52
authored
Oct 27, 2016
by
Gabor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Variable renames + lv_img bugfix (last pixels were incorrect)
parent
9be8839a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
31 deletions
+33
-31
lv_obj.c
lv_obj/lv_obj.c
+1
-1
lv_obj.h
lv_obj/lv_obj.h
+2
-2
lv_img.c
lv_objx/lv_img.c
+1
-1
lv_list.c
lv_objx/lv_list.c
+22
-22
lv_list.h
lv_objx/lv_list.h
+4
-4
lv_page.c
lv_objx/lv_page.c
+2
-0
lv_rect.c
lv_objx/lv_rect.c
+1
-1
No files found.
lv_obj/lv_obj.c
View file @
320a5b52
...
...
@@ -956,7 +956,7 @@ void * lv_obj_alloc_ext(lv_obj_t * obj, uint16_t ext_size)
* Send a 'LV_SIGNAL_REFR_EXT_SIZE' signal to the object
* @param obj pointer to an object
*/
void
lv_obj_
ext_size_refr
(
lv_obj_t
*
obj
)
void
lv_obj_
refr_ext_size
(
lv_obj_t
*
obj
)
{
obj
->
ext_size
=
0
;
obj
->
signal_f
(
obj
,
LV_SIGNAL_REFR_EXT_SIZE
,
NULL
);
...
...
lv_obj/lv_obj.h
View file @
320a5b52
...
...
@@ -197,7 +197,7 @@ void lv_obj_set_height(lv_obj_t * obj, cord_t h);
void
lv_obj_set_height_us
(
lv_obj_t
*
obj
,
cord_t
h
);
void
lv_obj_align
(
lv_obj_t
*
obj
,
lv_obj_t
*
base
,
lv_align_t
align
,
cord_t
x_mod
,
cord_t
y_mod
);
void
lv_obj_align_us
(
lv_obj_t
*
obj
,
lv_obj_t
*
base
,
lv_align_t
align
,
cord_t
x_mod
,
cord_t
y_mod
);
void
lv_obj_set_ext_size
(
lv_obj_t
*
obj
,
cord_t
ext_size
);
;
void
lv_obj_set_ext_size
(
lv_obj_t
*
obj
,
cord_t
ext_size
);
/*Appearance set*/
void
lv_obj_set_hidden
(
lv_obj_t
*
obj
,
bool
hidden_en
);
void
lv_obj_set_opa
(
lv_obj_t
*
obj
,
opa_t
opa
);
...
...
@@ -212,7 +212,7 @@ void lv_obj_set_signal_f(lv_obj_t * obj, lv_signal_f_t fp);
void
lv_obj_set_design_f
(
lv_obj_t
*
obj
,
lv_design_f_t
fp
);
/*Other set*/
void
*
lv_obj_alloc_ext
(
lv_obj_t
*
obj
,
uint16_t
ext_size
);
void
lv_obj_
ext_size_refr
(
lv_obj_t
*
obj
);
void
lv_obj_
refr_ext_size
(
lv_obj_t
*
obj
);
void
lv_obj_set_style
(
lv_obj_t
*
obj
,
void
*
style_p
);
void
*
lv_obj_iso_style
(
lv_obj_t
*
obj
,
uint32_t
style_size
);
void
lv_obj_set_free_num
(
lv_obj_t
*
obj
,
uint8_t
free_num
);
...
...
lv_objx/lv_img.c
View file @
320a5b52
...
...
@@ -165,7 +165,7 @@ fs_res_t lv_img_create_file(const char * fn, const color_int_t * data)
{
const
lv_img_raw_header_t
*
raw_p
=
(
lv_img_raw_header_t
*
)
data
;
fs_res_t
res
;
res
=
ufs_create_const
(
fn
,
data
,
raw_p
->
w
*
raw_p
->
h
*
sizeof
(
color_t
));
res
=
ufs_create_const
(
fn
,
data
,
raw_p
->
w
*
raw_p
->
h
*
sizeof
(
color_t
)
+
sizeof
(
lv_img_raw_header_t
)
);
return
res
;
}
...
...
lv_objx/lv_list.c
View file @
320a5b52
...
...
@@ -118,7 +118,7 @@ lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, b
/*Create a list element with the image an the text*/
lv_obj_t
*
liste
;
liste
=
lv_btn_create
(
list
,
NULL
);
lv_obj_set_style
(
liste
,
&
lists
->
liste_btn
);
lv_obj_set_style
(
liste
,
&
lists
->
liste_btn
s
);
lv_btn_set_rel_action
(
liste
,
rel_action
);
lv_page_glue_obj
(
liste
,
true
);
lv_rect_set_layout
(
liste
,
lists
->
liste_layout
);
...
...
@@ -127,14 +127,14 @@ lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, b
if
(
img_fn
!=
NULL
)
{
lv_obj_t
*
img
=
lv_img_create
(
liste
,
NULL
);
lv_img_set_file
(
img
,
img_fn
);
lv_obj_set_style
(
img
,
&
lists
->
liste_img
);
lv_obj_set_style
(
img
,
&
lists
->
liste_img
s
);
lv_obj_set_click
(
img
,
false
);
}
if
(
txt
!=
NULL
)
{
lv_obj_t
*
label
=
lv_label_create
(
liste
,
NULL
);
lv_label_set_text
(
label
,
txt
);
lv_obj_set_style
(
label
,
&
lists
->
liste_label
);
lv_obj_set_style
(
label
,
&
lists
->
liste_label
s
);
lv_obj_set_click
(
label
,
false
);
}
...
...
@@ -143,8 +143,8 @@ lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, b
/*Now the width will be adjusted*/
lv_rect_set_fit
(
liste
,
false
,
true
);
cord_t
w
=
lv_obj_get_width
(
list
);
w
-=
lists
->
bg_page
.
bg_rects
.
hpad
*
2
;
w
-=
lists
->
bg_page
.
scrable_rects
.
hpad
*
2
;
w
-=
lists
->
bg_page
s
.
bg_rects
.
hpad
*
2
;
w
-=
lists
->
bg_page
s
.
scrable_rects
.
hpad
*
2
;
lv_obj_set_width
(
liste
,
w
);
}
else
if
(
ext
->
fit
==
LV_LIST_FIT_LONGEST
)
{
/*In this case the width will be adjusted*/
...
...
@@ -322,32 +322,32 @@ static bool lv_list_design(lv_obj_t * list, const area_t * mask, lv_design_mode_
static
void
lv_lists_init
(
void
)
{
/*Default style*/
lv_pages_get
(
LV_PAGES_TRANSP
,
&
lv_lists_def
.
bg_page
);
lv_lists_def
.
bg_page
.
bg_rects
.
vpad
=
0
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
.
bg_rects
.
hpad
=
0
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
.
bg_rects
.
opad
=
0
*
LV_STYLE_MULT
;
lv_pages_get
(
LV_PAGES_TRANSP
,
&
lv_lists_def
.
bg_page
s
);
lv_lists_def
.
bg_page
s
.
bg_rects
.
vpad
=
0
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
s
.
bg_rects
.
hpad
=
0
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
s
.
bg_rects
.
opad
=
0
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
.
scrable_rects
.
vpad
=
10
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
.
scrable_rects
.
hpad
=
10
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
.
scrable_rects
.
opad
=
5
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
s
.
scrable_rects
.
vpad
=
10
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
s
.
scrable_rects
.
hpad
=
10
*
LV_STYLE_MULT
;
lv_lists_def
.
bg_page
s
.
scrable_rects
.
opad
=
5
*
LV_STYLE_MULT
;
lv_btns_get
(
LV_BTNS_DEF
,
&
lv_lists_def
.
liste_btn
);
/*List element button style*/
lv_btns_get
(
LV_BTNS_DEF
,
&
lv_lists_def
.
liste_btn
s
);
/*List element button style*/
lv_labels_get
(
LV_LABELS_BTN
,
&
lv_lists_def
.
liste_label
);
/*List element label style*/
lv_lists_def
.
liste_label
.
mid
=
0
;
lv_labels_get
(
LV_LABELS_BTN
,
&
lv_lists_def
.
liste_label
s
);
/*List element label style*/
lv_lists_def
.
liste_label
s
.
mid
=
0
;
lv_imgs_get
(
LV_IMGS_DEF
,
&
lv_lists_def
.
liste_img
);
/*Lit element image style*/
lv_imgs_get
(
LV_IMGS_DEF
,
&
lv_lists_def
.
liste_img
s
);
/*Lit element image style*/
lv_lists_def
.
liste_layout
=
LV_RECT_LAYOUT_ROW_M
;
memcpy
(
&
lv_lists_tight
,
&
lv_lists_def
,
sizeof
(
lv_lists_t
));
lv_lists_tight
.
bg_page
.
bg_rects
.
vpad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
.
bg_rects
.
hpad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
.
bg_rects
.
opad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
s
.
bg_rects
.
vpad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
s
.
bg_rects
.
hpad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
s
.
bg_rects
.
opad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
.
scrable_rects
.
vpad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
.
scrable_rects
.
hpad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
.
scrable_rects
.
opad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
s
.
scrable_rects
.
vpad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
s
.
scrable_rects
.
hpad
=
0
*
LV_STYLE_MULT
;
lv_lists_tight
.
bg_page
s
.
scrable_rects
.
opad
=
0
*
LV_STYLE_MULT
;
}
#endif
lv_objx/lv_list.h
View file @
320a5b52
...
...
@@ -29,11 +29,11 @@
/*Style of list*/
typedef
struct
{
lv_pages_t
bg_page
;
/*Style of ancestor*/
lv_pages_t
bg_page
s
;
/*Style of ancestor*/
/*New style element for this type */
lv_btns_t
liste_btn
;
lv_labels_t
liste_label
;
lv_imgs_t
liste_img
;
lv_btns_t
liste_btn
s
;
lv_labels_t
liste_label
s
;
lv_imgs_t
liste_img
s
;
lv_rect_layout_t
liste_layout
;
}
lv_lists_t
;
...
...
lv_objx/lv_page.c
View file @
320a5b52
...
...
@@ -350,6 +350,8 @@ static bool lv_page_design(lv_obj_t * page, const area_t * mask, lv_design_mode_
}
else
if
(
mode
==
LV_DESIGN_DRAW_MAIN
)
{
ancestor_design_f
(
page
,
mask
,
mode
);
}
else
if
(
mode
==
LV_DESIGN_DRAW_POST
)
{
/*Draw the scroll bars finally*/
ancestor_design_f
(
page
,
mask
,
mode
);
lv_page_ext_t
*
ext
=
lv_obj_get_ext
(
page
);
lv_pages_t
*
style
=
lv_obj_get_style
(
page
);
opa_t
sb_opa
=
lv_obj_get_opa
(
page
)
*
style
->
sb_opa
/
100
;
...
...
lv_objx/lv_rect.c
View file @
320a5b52
...
...
@@ -120,7 +120,7 @@ bool lv_rect_signal(lv_obj_t * rect, lv_signal_t sign, void * param)
case
LV_SIGNAL_STYLE_CHG
:
/*Recalculate the padding if the style changed*/
lv_rect_refr_layout
(
rect
);
lv_rect_refr_autofit
(
rect
);
lv_obj_
ext_size_refr
(
rect
);
lv_obj_
refr_ext_size
(
rect
);
break
;
case
LV_SIGNAL_CHILD_CHG
:
lv_rect_refr_layout
(
rect
);
...
...
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