Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
e50346b1
Commit
e50346b1
authored
Apr 15, 2011
by
Ludovic Fauvet
Committed by
Jean-Baptiste Kempf
Apr 16, 2011
Browse files
Qt4: change the handle size and color
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
b6438f79
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/gui/qt4/util/input_slider.cpp
View file @
e50346b1
...
...
@@ -37,6 +37,7 @@
#include
<QStyleOptionSlider>
#include
<QLinearGradient>
#include
<QTimer>
#include
<QRadialGradient>
#define MINIMUM 0
#define MAXIMUM 1000
...
...
@@ -288,32 +289,31 @@ void SeekSlider::paintEvent( QPaintEvent *event )
// draw handle
if
(
option
.
state
&
QStyle
::
State_MouseOver
)
{
QLinearGradient
buttonGradient
(
0
,
0
,
0
,
height
()
);
buttonGradient
.
setColorAt
(
0.0
,
QColor
(
1
,
92
,
195
)
);
buttonGradient
.
setColorAt
(
0.40
,
QColor
(
41
,
80
,
124
)
);
buttonGradient
.
setColorAt
(
1.0
,
QColor
(
1
,
92
,
195
)
);
painter
.
setPen
(
QPen
(
Qt
::
blue
)
);
painter
.
setBrush
(
buttonGradient
);
if
(
sliderPos
!=
-
1
)
{
const
int
margin
=
5
;
QSize
hs
=
handleSize
()
-
QSize
(
2
,
2
);
QSize
hs
=
handleSize
()
-
QSize
(
5
,
5
);
QPoint
pos
;
switch
(
orientation
()
)
{
case
Qt
::
Horizontal
:
pos
=
QPoint
(
sliderPos
-
(
h
andleSize
()
.
width
()
/
2
),
1
);
pos
=
QPoint
(
sliderPos
-
(
h
s
.
width
()
/
2
),
2
);
pos
.
rx
()
=
qMax
(
margin
,
pos
.
x
()
);
pos
.
rx
()
=
qMin
(
width
()
-
hs
.
width
()
-
margin
,
pos
.
x
()
);
break
;
case
Qt
::
Vertical
:
pos
=
QPoint
(
1
,
height
()
-
(
sliderPos
+
(
h
andleSize
()
.
height
()
/
2
)
)
);
pos
=
QPoint
(
2
,
height
()
-
(
sliderPos
+
(
h
s
.
height
()
/
2
)
)
);
pos
.
ry
()
=
qMax
(
margin
,
pos
.
y
()
);
pos
.
ry
()
=
qMin
(
height
()
-
hs
.
height
()
-
margin
,
pos
.
y
()
);
break
;
}
QRadialGradient
buttonGradient
(
pos
.
x
()
+
(
hs
.
width
()
/
2
)
-
2
,
pos
.
y
()
+
(
hs
.
height
()
/
2
)
-
2
,
qMax
(
hs
.
width
(),
hs
.
height
()
)
);
buttonGradient
.
setColorAt
(
0.0
,
QColor
(
0
,
0
,
0
)
);
buttonGradient
.
setColorAt
(
1.0
,
QColor
(
80
,
80
,
80
)
);
painter
.
setPen
(
Qt
::
NoPen
);
painter
.
setBrush
(
buttonGradient
);
painter
.
drawEllipse
(
pos
.
x
(),
pos
.
y
(),
hs
.
width
(),
hs
.
height
()
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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