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
d58a83cd
Commit
d58a83cd
authored
Mar 21, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_mbox: Translate LV_GROUP_KEY_UP/DOWN to LV_GROUP_KEY_LEFT/RIGHT
parent
69c5373d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
lv_btnm.c
lv_objx/lv_btnm.c
+5
-4
lv_mbox.c
lv_objx/lv_mbox.c
+10
-1
No files found.
lv_objx/lv_btnm.c
View file @
d58a83cd
...
...
@@ -602,7 +602,8 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
break
;
}
}
ext
->
btn_id_pr
=
area_below
;
if
(
area_below
<
ext
->
btn_cnt
)
ext
->
btn_id_pr
=
area_below
;
}
lv_obj_invalidate
(
btnm
);
}
else
if
(
c
==
LV_GROUP_KEY_UP
)
{
...
...
@@ -611,10 +612,10 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
if
(
ext
->
btn_id_pr
==
LV_BTNM_PR_NONE
)
{
ext
->
btn_id_pr
=
0
;
}
else
{
u
int16_t
area_above
;
int16_t
area_above
;
lv_coord_t
pr_center
=
ext
->
button_areas
[
ext
->
btn_id_pr
].
x1
+
(
lv_area_get_width
(
&
ext
->
button_areas
[
ext
->
btn_id_pr
])
>>
1
);
for
(
area_above
=
ext
->
btn_id_pr
;
area_above
>
0
;
area_above
--
)
{
for
(
area_above
=
ext
->
btn_id_pr
;
area_above
>
=
0
;
area_above
--
)
{
if
(
ext
->
button_areas
[
area_above
].
y1
<
ext
->
button_areas
[
ext
->
btn_id_pr
].
y1
&&
pr_center
>=
ext
->
button_areas
[
area_above
].
x1
-
style
->
body
.
padding
.
hor
&&
pr_center
<=
ext
->
button_areas
[
area_above
].
x2
)
...
...
@@ -622,7 +623,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
break
;
}
}
ext
->
btn_id_pr
=
area_above
;
if
(
area_above
>=
0
)
ext
->
btn_id_pr
=
area_above
;
}
lv_obj_invalidate
(
btnm
);
...
...
lv_objx/lv_mbox.c
View file @
d58a83cd
...
...
@@ -348,6 +348,16 @@ static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
{
lv_res_t
res
;
/*Translate LV_GROUP_KEY_UP/DOWN to LV_GROUP_KEY_LEFT/RIGHT */
char
c_trans
=
0
;
if
(
sign
==
LV_SIGNAL_CONTROLL
)
{
c_trans
=
*
((
char
*
)
param
);
if
(
c_trans
==
LV_GROUP_KEY_DOWN
)
c_trans
=
LV_GROUP_KEY_LEFT
;
if
(
c_trans
==
LV_GROUP_KEY_UP
)
c_trans
=
LV_GROUP_KEY_RIGHT
;
param
=
&
c_trans
;
}
/* Include the ancient signal function */
res
=
ancestor_signal
(
mbox
,
sign
,
param
);
if
(
res
!=
LV_RES_OK
)
return
res
;
...
...
@@ -356,7 +366,6 @@ static lv_res_t lv_mbox_signal(lv_obj_t * mbox, lv_signal_t sign, void * param)
if
(
sign
==
LV_SIGNAL_CORD_CHG
)
{
if
(
lv_obj_get_width
(
mbox
)
!=
lv_area_get_width
(
param
))
{
mbox_realign
(
mbox
);
}
}
else
if
(
sign
==
LV_SIGNAL_STYLE_CHG
)
{
...
...
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