Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
094d50f7
Commit
094d50f7
authored
Apr 16, 2011
by
Ludovic Fauvet
Committed by
Jean-Baptiste Kempf
Apr 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: add some comments
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
b00fb1c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+13
-2
No files found.
modules/gui/qt4/util/input_slider.cpp
View file @
094d50f7
...
...
@@ -56,6 +56,8 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent )
seekLimitTimer
=
new
QTimer
(
this
);
seekLimitTimer
->
setSingleShot
(
true
);
/* Timer used to avoid flickering when the mouse leave the slider
and is over the tooltip */
hideTooltipTimer
=
new
QTimer
(
this
);
hideTooltipTimer
->
setSingleShot
(
true
);
...
...
@@ -175,6 +177,7 @@ void SeekSlider::wheelEvent( QWheelEvent *event )
void
SeekSlider
::
enterEvent
(
QEvent
*
e
)
{
/* Don't show the tooltip if the slider is disabled */
if
(
isEnabled
()
)
{
hideTooltipTimer
->
stop
();
...
...
@@ -184,13 +187,14 @@ void SeekSlider::enterEvent( QEvent *e )
void
SeekSlider
::
leaveEvent
(
QEvent
*
e
)
{
/* Wait 100ms before hiding the tooltip */
hideTooltipTimer
->
start
(
100
);
}
bool
SeekSlider
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
/
/
This eventFilter avoids a flicker that occurs if the
// mouse cursor leaves the SeekSlider for the TimeTooltip.
/
*
This eventFilter avoids a flicker that occurs if the
mouse cursor leaves the SeekSlider for the TimeTooltip. */
if
(
obj
==
mTimeTooltip
)
{
if
(
event
->
type
()
==
QEvent
::
Enter
)
...
...
@@ -232,6 +236,7 @@ void SeekSlider::paintEvent( QPaintEvent *event )
int
range
=
MAXIMUM
;
QRect
barRect
=
rect
();
// adjust positions based on the current orientation
if
(
option
.
sliderPosition
!=
0
)
{
switch
(
orientation
()
)
...
...
@@ -259,24 +264,29 @@ void SeekSlider::paintEvent( QPaintEvent *event )
barRect
.
moveCenter
(
rect
().
center
()
);
// set the background color and gradient
QColor
backgroundBase
(
135
,
135
,
135
);
QLinearGradient
backgroundGradient
(
0
,
0
,
0
,
height
()
);
backgroundGradient
.
setColorAt
(
0.0
,
backgroundBase
);
backgroundGradient
.
setColorAt
(
1.0
,
backgroundBase
.
lighter
(
150
)
);
// set the foreground color and gradient
QColor
foregroundBase
(
50
,
156
,
255
);
QLinearGradient
foregroundGradient
(
0
,
0
,
0
,
height
()
);
foregroundGradient
.
setColorAt
(
0.0
,
foregroundBase
);
foregroundGradient
.
setColorAt
(
1.0
,
foregroundBase
.
darker
(
140
)
);
// draw a slight 3d effect on the bottom
painter
.
setPen
(
QColor
(
230
,
230
,
230
)
);
painter
.
setBrush
(
Qt
::
NoBrush
);
painter
.
drawRoundedRect
(
barRect
.
adjusted
(
0
,
2
,
0
,
0
),
barCorner
,
barCorner
);
// draw background
painter
.
setPen
(
Qt
::
NoPen
);
painter
.
setBrush
(
backgroundGradient
);
painter
.
drawRoundedRect
(
barRect
,
barCorner
,
barCorner
);
// adjusted foreground rectangle
QRect
valueRect
=
barRect
.
adjusted
(
1
,
1
,
-
1
,
0
);
switch
(
orientation
()
)
...
...
@@ -292,6 +302,7 @@ void SeekSlider::paintEvent( QPaintEvent *event )
if
(
option
.
sliderPosition
>
minimum
()
&&
option
.
sliderPosition
<=
maximum
()
)
{
// draw foreground
painter
.
setPen
(
Qt
::
NoPen
);
painter
.
setBrush
(
foregroundGradient
);
painter
.
drawRoundedRect
(
valueRect
,
barCorner
,
barCorner
);
...
...
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