]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.cpp
Qt: FSC opacity control between 0.1 and 1.0
[vlc] / modules / gui / qt4 / components / interface_widgets.cpp
index e9a26db5bba0cb790f7c47ec6bbb8d320bae9612..5b4d532fc0f0cc7db35da773859644a94d7df8b9 100644 (file)
@@ -121,13 +121,13 @@ WId VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
 
 /* Set the Widget to the correct Size */
 /* Function has to be called by the parent
-   Parent has to care about resizing himself*/
+   Parent has to care about resizing itself */
 void VideoWidget::SetSizing( unsigned int w, unsigned int h )
 {
     msg_Dbg( p_intf, "Video is resizing to: %i %i", w, h );
     videoSize.rwidth() = w;
     videoSize.rheight() = h;
-    if( isHidden() ) show();
+    if( !isVisible() ) show();
     updateGeometry(); // Needed for deinterlace
 }
 
@@ -175,9 +175,9 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
     label->setMinimumHeight( MIN_BG_SIZE );
     label->setMinimumWidth( MIN_BG_SIZE );
     if( QDate::currentDate().dayOfYear() >= 354 )
-        label->setPixmap( QPixmap( ":/vlc128-christmas.png" ) );
+        label->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) );
     else
-        label->setPixmap( QPixmap( ":/vlc128.png" ) );
+        label->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
 
     QGridLayout *backgroundLayout = new QGridLayout( this );
     backgroundLayout->addWidget( label, 0, 1 );
@@ -185,7 +185,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
     backgroundLayout->setColumnStretch( 2, 1 );
 
     CONNECT( THEMIM->getIM(), artChanged( QString ),
-             this, updateArt( QString ) );
+             this, updateArt( const QString& ) );
 }
 
 BackgroundWidget::~BackgroundWidget()
@@ -199,14 +199,14 @@ void BackgroundWidget::resizeEvent( QResizeEvent * event )
         label->show();
 }
 
-void BackgroundWidget::updateArt( QString url )
+void BackgroundWidget::updateArt( const QString& url )
 {
     if( url.isEmpty() )
     {
         if( QDate::currentDate().dayOfYear() >= 354 )
-            label->setPixmap( QPixmap( ":/vlc128-christmas.png" ) );
+            label->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) );
         else
-            label->setPixmap( QPixmap( ":/vlc128.png" ) );
+            label->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
     }
     else
     {
@@ -404,24 +404,25 @@ void SpeedControlWidget::resetRate()
 }
 
 CoverArtLabel::CoverArtLabel( QWidget *parent, intf_thread_t *_p_i )
-        : QLabel( parent ), p_intf( _p_i )
+              : QLabel( parent ), p_intf( _p_i )
 {
     setContextMenuPolicy( Qt::ActionsContextMenu );
-    CONNECT( this, updateRequested(), this, doUpdate() );
+    CONNECT( this, updateRequested(), this, askForUpdate() );
     CONNECT( THEMIM->getIM(), artChanged( QString ),
-             this, doUpdate( QString ) );
+             this, showArtUpdate( const QString& ) );
 
     setMinimumHeight( 128 );
     setMinimumWidth( 128 );
     setMaximumHeight( 128 );
     setMaximumWidth( 128 );
     setScaledContents( true );
+
     QList< QAction* > artActions = actions();
     QAction *action = new QAction( qtr( "Download cover art" ), this );
+    CONNECT( action, triggered(), this, askForUpdate() );
     addAction( action );
-    CONNECT( action, triggered(), this, doUpdate() );
 
-    doUpdate();
+    showArtUpdate( "" );
 }
 
 CoverArtLabel::~CoverArtLabel()
@@ -431,7 +432,7 @@ CoverArtLabel::~CoverArtLabel()
         removeAction( act );
 }
 
-void CoverArtLabel::doUpdate( QString url )
+void CoverArtLabel::showArtUpdate( const QString& url )
 {
     QPixmap pix;
     if( !url.isEmpty()  && pix.load( url ) )
@@ -444,7 +445,7 @@ void CoverArtLabel::doUpdate( QString url )
     }
 }
 
-void CoverArtLabel::doUpdate()
+void CoverArtLabel::askForUpdate()
 {
     THEMIM->getIM()->requestArtUpdate();
 }