Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
f673748b
Commit
f673748b
authored
Nov 26, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Make the gradient fit INSIDE the boundaries...
parent
94b8b916
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+1
-1
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+6
-2
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
f673748b
...
...
@@ -522,7 +522,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
volumeSlider
->
setOrientation
(
Qt
::
Horizontal
);
}
volumeSlider
->
setMaximumSize
(
QSize
(
200
,
40
)
);
volumeSlider
->
setMinimumSize
(
QSize
(
80
,
2
0
)
);
volumeSlider
->
setMinimumSize
(
QSize
(
106
,
3
0
)
);
volumeSlider
->
setFocusPolicy
(
Qt
::
NoFocus
);
controlLayout
->
addWidget
(
volumeSlider
,
2
,
16
,
2
,
2
,
Qt
::
AlignBottom
);
...
...
modules/gui/qt4/util/input_slider.cpp
View file @
f673748b
...
...
@@ -84,6 +84,7 @@ SoundSlider::SoundSlider( QWidget *_parent, int _i_step, bool b_hard )
:
QAbstractSlider
(
_parent
)
{
padding
=
3
;
f_step
=
(
_i_step
*
100
)
/
AOUT_VOLUME_MAX
;
setRange
(
SOUNDMIN
,
b_hard
?
(
2
*
SOUNDMAX
)
:
SOUNDMAX
);
...
...
@@ -91,11 +92,13 @@ SoundSlider::SoundSlider( QWidget *_parent, int _i_step, bool b_hard )
const
QPixmap
temp
(
":/pixmaps/volume-slider-inside.png"
);
const
QBitmap
mask
(
temp
.
createHeuristicMask
()
);
setMinimumSize
(
pixOutside
.
size
()
);
pixGradient
=
QPixmap
(
mask
.
size
()
);
QPainter
p
(
&
pixGradient
);
QLinearGradient
gradient
(
0
,
padding
,
WLENGTH
+
2
*
padding
,
padding
);
QLinearGradient
gradient
(
padding
,
2
,
WLENGTH
,
2
);
gradient
.
setColorAt
(
0.0
,
Qt
::
white
);
gradient
.
setColorAt
(
0.2
,
QColor
(
20
,
226
,
20
)
);
gradient
.
setColorAt
(
0.5
,
QColor
(
255
,
176
,
15
)
);
...
...
@@ -175,7 +178,8 @@ void SoundSlider::paintEvent(QPaintEvent *e)
{
QPainter
painter
(
this
);
const
int
offset
=
int
(
double
(
(
width
()
-
2
*
padding
)
*
value
()
)
/
maximum
()
);
const
QRectF
boundsG
(
padding
,
padding
,
offset
,
pixGradient
.
height
()
);
const
QRectF
boundsG
(
0
,
0
,
offset
,
pixGradient
.
height
()
);
painter
.
drawPixmap
(
boundsG
,
pixGradient
,
boundsG
);
const
QRectF
boundsO
(
0
,
0
,
pixOutside
.
width
(),
pixOutside
.
height
()
);
...
...
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