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
b5360cd0
Commit
b5360cd0
authored
Oct 04, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: BackGroundWidget: fade in background
parent
e82b763a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+18
-0
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+3
-0
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
b5360cd0
...
...
@@ -199,6 +199,16 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
/* Init the cone art */
updateArt
(
""
);
/* fade in animator */
setProperty
(
"opacity"
,
1.0
);
fadeAnimation
=
new
QPropertyAnimation
(
this
,
"opacity"
,
this
);
fadeAnimation
->
setDuration
(
1000
);
fadeAnimation
->
setStartValue
(
0.0
);
fadeAnimation
->
setEndValue
(
1.0
);
fadeAnimation
->
setEasingCurve
(
QEasingCurve
::
OutSine
);
CONNECT
(
fadeAnimation
,
valueChanged
(
const
QVariant
&
),
this
,
update
()
);
CONNECT
(
THEMIM
->
getIM
(),
artChanged
(
QString
),
this
,
updateArt
(
const
QString
&
)
);
}
...
...
@@ -219,6 +229,12 @@ void BackgroundWidget::updateArt( const QString& url )
update
();
}
void
BackgroundWidget
::
showEvent
(
QShowEvent
*
e
)
{
Q_UNUSED
(
e
);
if
(
b_withart
)
fadeAnimation
->
start
();
}
void
BackgroundWidget
::
paintEvent
(
QPaintEvent
*
e
)
{
if
(
!
b_withart
)
...
...
@@ -237,6 +253,8 @@ void BackgroundWidget::paintEvent( QPaintEvent *e )
i_maxwidth
=
__MIN
(
maximumWidth
(),
width
()
)
-
MARGIN
*
2
;
i_maxheight
=
__MIN
(
maximumHeight
(),
height
()
)
-
MARGIN
*
2
;
painter
.
setOpacity
(
property
(
"opacity"
).
toFloat
()
);
if
(
height
()
>
MARGIN
*
2
)
{
/* Scale down the pixmap if the widget is too small */
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
b5360cd0
...
...
@@ -42,6 +42,7 @@
#include <QFrame>
#include <QLabel>
#include <QMouseEvent>
#include <QPropertyAnimation>
class
ResizeEvent
;
class
QPixmap
;
...
...
@@ -93,9 +94,11 @@ private:
QString
pixmapUrl
;
bool
b_expandPixmap
;
bool
b_withart
;
QPropertyAnimation
*
fadeAnimation
;
virtual
void
contextMenuEvent
(
QContextMenuEvent
*
event
);
protected:
void
paintEvent
(
QPaintEvent
*
e
);
virtual
void
showEvent
(
QShowEvent
*
e
);
static
const
int
MARGIN
=
5
;
public
slots
:
void
toggle
(){
TOGGLEV
(
this
);
}
...
...
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