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
f7c8fe98
Commit
f7c8fe98
authored
Oct 09, 2017
by
scopa90
Committed by
GitHub
Oct 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update lv_btn.c
Allow NULL as parameter to lv_btn_set_styles for any style which is not to be changed.
parent
eb067af0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
lv_btn.c
lv_objx/lv_btn.c
+11
-7
No files found.
lv_objx/lv_btn.c
View file @
f7c8fe98
...
...
@@ -295,7 +295,7 @@ void lv_btn_set_lpr_rep_action(lv_obj_t * btn, lv_action_t lpr_rep_action)
}
/**
* Set styles of a button is each state
* Set styles of a button is each state
. Use NULL for any style which are not be changed.
* @param btn pointer to button object
* @param rel pointer to a style for releases state
* @param pr pointer to a style for pressed state
...
...
@@ -308,14 +308,18 @@ void lv_btn_set_styles(lv_obj_t * btn, lv_style_t * rel, lv_style_t * pr,
lv_style_t
*
ina
)
{
lv_btn_ext_t
*
ext
=
lv_obj_get_ext
(
btn
);
ext
->
styles
[
LV_BTN_STATE_REL
]
=
rel
;
ext
->
styles
[
LV_BTN_STATE_PR
]
=
pr
;
ext
->
styles
[
LV_BTN_STATE_TREL
]
=
trel
;
ext
->
styles
[
LV_BTN_STATE_TPR
]
=
tpr
;
ext
->
styles
[
LV_BTN_STATE_INA
]
=
ina
;
lv_obj_set_style
(
btn
,
ext
->
styles
[
ext
->
state
]);
if
(
rel
!=
NULL
)
ext
->
styles
[
LV_BTN_STATE_REL
]
=
rel
;
if
(
pr
!=
NULL
)
ext
->
styles
[
LV_BTN_STATE_PR
]
=
pr
;
if
(
trel
)
ext
->
styles
[
LV_BTN_STATE_TREL
]
=
trel
;
if
(
tpr
)
ext
->
styles
[
LV_BTN_STATE_TPR
]
=
tpr
;
if
(
ina
)
ext
->
styles
[
LV_BTN_STATE_INA
]
=
ina
;
lv_obj_set_style
(
btn
,
ext
->
styles
[
ext
->
state
]);
}
/*=====================
...
...
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