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
7310a2c6
Commit
7310a2c6
authored
Feb 24, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add LV_PROTECT_PRESS_LOST
parent
6e6a7de1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
11 deletions
+14
-11
lv_indev.c
lv_core/lv_indev.c
+4
-3
lv_obj.h
lv_core/lv_obj.h
+4
-2
lv_draw.c
lv_draw/lv_draw.c
+1
-1
lv_page.c
lv_objx/lv_page.c
+1
-1
lv_slider.c
lv_objx/lv_slider.c
+4
-4
No files found.
lv_core/lv_indev.c
View file @
7310a2c6
...
...
@@ -346,12 +346,13 @@ static void indev_proc_press(lv_indev_proc_t * info)
pr_obj
=
indev_search_obj
(
info
,
lv_layer_top
());
if
(
pr_obj
==
NULL
)
pr_obj
=
indev_search_obj
(
info
,
lv_scr_act
());
}
/*If there is last object but it is not dragged also search*/
else
if
(
info
->
drag_in_prog
==
0
)
{
/*Now act_obj != NULL*/
/*If there is last object but it is not dragged and not protected also search*/
else
if
(
info
->
drag_in_prog
==
0
&&
lv_obj_is_protected
(
info
->
act_obj
,
LV_PROTECT_PRESS_LOST
)
==
false
)
{
/*Now act_obj != NULL*/
pr_obj
=
indev_search_obj
(
info
,
lv_layer_top
());
if
(
pr_obj
==
NULL
)
pr_obj
=
indev_search_obj
(
info
,
lv_scr_act
());
}
/*If a dragable object was the last then keep it*/
/*If a dragable o
r a protected o
bject was the last then keep it*/
else
{
}
...
...
lv_core/lv_obj.h
View file @
7310a2c6
...
...
@@ -117,8 +117,9 @@ typedef struct _lv_obj_t
void
*
free_ptr
;
/*Application specific pointer (set it freely)*/
#endif
void
*
group_p
;
/*Pointer to the group of the object*/
#if USE_LV_GROUP != 0
void
*
group_p
;
/*Pointer to the group of the object*/
#endif
/*Attributes and states*/
uint8_t
click
:
1
;
/*1: Can be pressed by an input device*/
uint8_t
drag
:
1
;
/*1: Enable the dragging*/
...
...
@@ -147,6 +148,7 @@ typedef enum
LV_PROTECT_PARENT
=
0x02
,
/*Prevent automatic parent change (e.g. in lv_page)*/
LV_PROTECT_POS
=
0x04
,
/*Prevent automatic positioning (e.g. in lv_cont layout)*/
LV_PROTECT_FOLLOW
=
0x08
,
/*Prevent the object be followed in automatic ordering (e.g. in lv_cont PRETTY layout)*/
LV_PROTECT_PRESS_LOST
=
0x10
,
/*TODO */
}
lv_protect_t
;
typedef
enum
...
...
lv_draw/lv_draw.c
View file @
7310a2c6
...
...
@@ -1755,7 +1755,7 @@ static void lv_draw_shadow_full(const lv_area_t * coords, const lv_area_t * mask
bool
line_ready
;
for
(
line
=
1
;
line
<=
radius
+
swidth
;
line
++
)
{
/*Check all rows and make the 1D blur to 2D*/
line_ready
=
false
;
for
(
col
=
1
;
col
<
radius
+
swidth
+
1
;
col
++
)
{
/*Check all pixels in a 1D blur line (from the origo to last shadow pixel (radius + swidth))*/
for
(
col
=
1
;
col
<
radius
+
swidth
+
1
0
;
col
++
)
{
/*Check all pixels in a 1D blur line (from the origo to last shadow pixel (radius + swidth))*/
/*Sum the opacities from the lines above and below this 'row'*/
int16_t
line_rel
;
...
...
lv_objx/lv_page.c
View file @
7310a2c6
...
...
@@ -81,7 +81,7 @@ lv_obj_t * lv_page_create(lv_obj_t * par, lv_obj_t * copy)
lv_obj_set_design_func
(
ext
->
scrl
,
lv_scrl_design
);
lv_obj_set_drag
(
ext
->
scrl
,
true
);
lv_obj_set_drag_throw
(
ext
->
scrl
,
true
);
lv_obj_set_protect
(
ext
->
scrl
,
LV_PROTECT_PARENT
);
lv_obj_set_protect
(
ext
->
scrl
,
LV_PROTECT_PARENT
|
LV_PROTECT_PRESS_LOST
);
lv_cont_set_fit
(
ext
->
scrl
,
false
,
true
);
/* Add the signal function only if 'scrolling' is created
...
...
lv_objx/lv_slider.c
View file @
7310a2c6
/**
* @file lv_slider.c
*
...
...
@@ -77,6 +78,7 @@ lv_obj_t * lv_slider_create(lv_obj_t * par, lv_obj_t * copy)
/*Init the new slider slider*/
if
(
copy
==
NULL
)
{
lv_obj_set_click
(
new_slider
,
true
);
lv_obj_set_protect
(
new_slider
,
LV_PROTECT_PRESS_LOST
);
/*Set the default styles*/
lv_theme_t
*
th
=
lv_theme_get_current
();
...
...
@@ -421,14 +423,12 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par
lv_style_t
*
knob_style
=
lv_slider_get_style
(
slider
,
LV_SLIDER_STYLE_KNOB
);
lv_coord_t
shadow_w
=
knob_style
->
body
.
shadow
.
width
;
if
(
ext
->
knob_in
==
0
)
{
/* The smaller size is the knob diameter
* +2 for the possible rounding error*/
lv_coord_t
x
=
LV_MATH_MIN
(
w
/
2
+
2
+
shadow_w
,
h
/
2
+
2
+
shadow_w
);
/* The smaller size is the knob diameter*/
lv_coord_t
x
=
LV_MATH_MIN
(
w
/
2
+
1
+
shadow_w
,
h
/
2
+
1
+
shadow_w
);
if
(
slider
->
ext_size
<
x
)
slider
->
ext_size
=
x
;
}
else
{
lv_coord_t
pad
=
LV_MATH_MIN
(
style
->
body
.
padding
.
hor
,
style
->
body
.
padding
.
ver
);
if
(
pad
<
0
)
pad
=
-
pad
;
if
(
pad
<
1
)
pad
=
1
;
/*For possible rounding errors*/
if
(
slider
->
ext_size
<
pad
)
slider
->
ext_size
=
pad
;
if
(
slider
->
ext_size
<
shadow_w
)
slider
->
ext_size
=
shadow_w
;
...
...
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