Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
a89d768c
Commit
a89d768c
authored
Sep 26, 2011
by
Ludovic Fauvet
Committed by
Jean-Baptiste Kempf
Sep 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: improve look and feel of the seek handle
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
c40ffdfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
12 deletions
+39
-12
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+38
-12
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+1
-0
No files found.
modules/gui/qt4/util/input_slider.cpp
View file @
a89d768c
...
...
@@ -6,6 +6,7 @@
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
* Ludovic Fauvet <etix@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -40,6 +41,11 @@
#include <QLinearGradient>
#include <QTimer>
#include <QRadialGradient>
#include <QLinearGradient>
#include <QSize>
#include <QPalette>
#include <QColor>
#include <QPoint>
#define MINIMUM 0
#define MAXIMUM 1000
...
...
@@ -433,32 +439,52 @@ void SeekSlider::paintEvent( QPaintEvent *event )
if
(
sliderPos
!=
-
1
)
{
const
int
margin
=
0
;
QSize
h
s
=
handleSize
()
-
QSize
(
5
,
5
);
QSize
h
Size
=
handleSize
()
-
QSize
(
6
,
6
);
QPoint
pos
;
switch
(
orientation
()
)
{
case
Qt
:
:
Horizontal
:
pos
=
QPoint
(
sliderPos
-
(
h
s
.
width
()
/
2
),
2
);
pos
=
QPoint
(
sliderPos
-
(
h
Size
.
width
()
/
2
),
2
);
pos
.
rx
()
=
qMax
(
margin
,
pos
.
x
()
);
pos
.
rx
()
=
qMin
(
width
()
-
h
s
.
width
()
-
margin
,
pos
.
x
()
);
pos
.
rx
()
=
qMin
(
width
()
-
h
Size
.
width
()
-
margin
,
pos
.
x
()
);
break
;
case
Qt
:
:
Vertical
:
pos
=
QPoint
(
2
,
height
()
-
(
sliderPos
+
(
h
s
.
height
()
/
2
)
)
);
pos
=
QPoint
(
2
,
height
()
-
(
sliderPos
+
(
h
Size
.
height
()
/
2
)
)
);
pos
.
ry
()
=
qMax
(
margin
,
pos
.
y
()
);
pos
.
ry
()
=
qMin
(
height
()
-
h
s
.
height
()
-
margin
,
pos
.
y
()
);
pos
.
ry
()
=
qMin
(
height
()
-
h
Size
.
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
)
);
QPalette
p
;
QPoint
shadowPos
(
pos
-
QPoint
(
2
,
2
)
);
QSize
sSize
(
handleSize
()
-
QSize
(
2
,
2
)
);
// prepare the handle's gradient
QLinearGradient
handleGradient
(
0
,
0
,
0
,
hSize
.
height
()
);
handleGradient
.
setColorAt
(
0.0
,
p
.
midlight
().
color
()
);
handleGradient
.
setColorAt
(
0.9
,
p
.
mid
().
color
()
);
// prepare the handle's shadow gradient
QColor
shadowDark
(
p
.
shadow
().
color
().
darker
(
150
)
);
QColor
shadowLight
(
p
.
shadow
().
color
().
lighter
(
180
)
);
shadowLight
.
setAlpha
(
50
);
QRadialGradient
shadowGradient
(
shadowPos
.
x
()
+
(
sSize
.
width
()
/
2
),
shadowPos
.
y
()
+
(
sSize
.
height
()
/
2
),
qMax
(
sSize
.
width
(),
sSize
.
height
()
)
/
2
);
shadowGradient
.
setColorAt
(
0.4
,
shadowDark
);
shadowGradient
.
setColorAt
(
1.0
,
shadowLight
);
painter
.
setPen
(
Qt
::
NoPen
);
painter
.
setBrush
(
buttonGradient
);
painter
.
drawEllipse
(
pos
.
x
(),
pos
.
y
(),
hs
.
width
(),
hs
.
height
()
);
// draw the handle's shadow
painter
.
setBrush
(
shadowGradient
);
painter
.
drawEllipse
(
shadowPos
.
x
(),
shadowPos
.
y
()
+
1
,
sSize
.
width
(),
sSize
.
height
()
);
// finally draw the handle
painter
.
setBrush
(
handleGradient
);
painter
.
drawEllipse
(
pos
.
x
(),
pos
.
y
(),
hSize
.
width
(),
hSize
.
height
()
);
}
}
}
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
a89d768c
...
...
@@ -6,6 +6,7 @@
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
* Ludovic Fauvet <etix@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
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