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
89b5907e
Commit
89b5907e
authored
May 08, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_slider: draw greater background on negative padding if knob_in == 1
parent
68d262ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
lv_slider.c
lv_objx/lv_slider.c
+15
-5
lv_theme_alien.c
lv_themes/lv_theme_alien.c
+2
-2
lv_theme_zen.c
lv_themes/lv_theme_zen.c
+2
-2
No files found.
lv_objx/lv_slider.c
View file @
89b5907e
...
...
@@ -273,11 +273,21 @@ static bool lv_slider_design(lv_obj_t * slider, const lv_area_t * mask, lv_desig
pad_hor_bg
=
(
lv_area_get_width
(
&
area_bg
)
-
LV_SLIDER_SIZE_MIN
)
>>
1
;
}
/*Let space only in the perpendicular directions*/
area_bg
.
x1
+=
slider_w
<
slider_h
?
pad_hor_bg
:
0
;
/*Pad only for vertical slider*/
area_bg
.
x2
-=
slider_w
<
slider_h
?
pad_hor_bg
:
0
;
/*Pad only for vertical slider*/
area_bg
.
y1
+=
slider_w
>
slider_h
?
pad_ver_bg
:
0
;
/*Pad only for horizontal slider*/
area_bg
.
y2
-=
slider_w
>
slider_h
?
pad_ver_bg
:
0
;
/*Pad only for horizontal slider*/
if
(
ext
->
knob_in
)
{
/*Enable extra size if the knob is inside */
if
(
pad_hor_bg
<
0
)
{
area_bg
.
x1
+=
pad_hor_bg
;
area_bg
.
x2
-=
pad_hor_bg
;
}
if
(
pad_ver_bg
<
0
)
{
area_bg
.
y1
+=
pad_hor_bg
;
area_bg
.
y2
-=
pad_hor_bg
;
}
}
else
{
/*Let space only in the perpendicular directions*/
area_bg
.
x1
+=
slider_w
<
slider_h
?
pad_hor_bg
:
0
;
/*Pad only for vertical slider*/
area_bg
.
x2
-=
slider_w
<
slider_h
?
pad_hor_bg
:
0
;
/*Pad only for vertical slider*/
area_bg
.
y1
+=
slider_w
>
slider_h
?
pad_ver_bg
:
0
;
/*Pad only for horizontal slider*/
area_bg
.
y2
-=
slider_w
>
slider_h
?
pad_ver_bg
:
0
;
/*Pad only for horizontal slider*/
}
lv_draw_rect
(
&
area_bg
,
mask
,
style_bg
);
/*Draw the indicator*/
...
...
lv_themes/lv_theme_alien.c
View file @
89b5907e
...
...
@@ -366,9 +366,9 @@ static void gauge_init(void)
lv_style_copy
(
&
gauge_bg
,
&
def
);
gauge_bg
.
body
.
main_color
=
lv_color_hsv_to_rgb
(
_hue
,
10
,
70
);
gauge_bg
.
body
.
grad_color
=
gauge_bg
.
body
.
main_color
;
gauge_bg
.
body
.
padding
.
hor
=
LV_DPI
/
1
2
;
/*Scale line length*/
gauge_bg
.
body
.
padding
.
hor
=
LV_DPI
/
1
6
;
/*Scale line length*/
gauge_bg
.
body
.
padding
.
ver
=
LV_DPI
/
10
;
/*Needle center size*/
gauge_bg
.
body
.
padding
.
inner
=
LV_DPI
/
8
;
/*Label - scale distance*/
gauge_bg
.
body
.
padding
.
inner
=
LV_DPI
/
12
;
/*Label - scale distance*/
gauge_bg
.
body
.
border
.
color
=
LV_COLOR_HEX3
(
0x777
);
gauge_bg
.
line
.
color
=
lv_color_hsv_to_rgb
(
_hue
,
80
,
75
);
gauge_bg
.
line
.
width
=
2
;
...
...
lv_themes/lv_theme_zen.c
View file @
89b5907e
...
...
@@ -283,10 +283,10 @@ static void gauge_init(void)
lv_style_copy
(
&
gauge
,
&
def
);
gauge
.
line
.
color
=
lv_color_hsv_to_rgb
(
_hue
,
50
,
70
);
gauge
.
line
.
width
=
2
;
gauge
.
line
.
width
=
1
;
gauge
.
body
.
main_color
=
LV_COLOR_HEX3
(
0x999
);
gauge
.
body
.
grad_color
=
gauge
.
body
.
main_color
;
gauge
.
body
.
padding
.
hor
=
LV_DPI
/
1
2
;
gauge
.
body
.
padding
.
hor
=
LV_DPI
/
1
6
;
gauge
.
body
.
border
.
color
=
LV_COLOR_HEX3
(
0x666
);
/*Needle middle color*/
theme
.
gauge
=
&
gauge
;
...
...
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