]> git.sesse.net Git - vlc/commitdiff
Qt: clean bgWidget
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 4 Mar 2010 21:37:33 +0000 (22:37 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 4 Mar 2010 21:59:26 +0000 (22:59 +0100)
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp

index 932b6bf82a88c7fd15946059d69ba48596e72ab4..cd1fb80c3ccd89129e381eea2e8f7b1a713b367a 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * interface_widgets.cpp : Custom widgets for the main interface
  ****************************************************************************
- * Copyright (C) 2006-2008 the VideoLAN team
+ * Copyright (C) 2006-2010 the VideoLAN team
  * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
@@ -88,7 +88,7 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i )
       , reparentable( NULL )
 {
     /* Set the policy to expand in both directions */
-//    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
+    // setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
 
     layout = new QHBoxLayout( this );
     layout->setContentsMargins( 0, 0, 0, 0 );
@@ -287,7 +287,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
                  :QWidget( NULL ), p_intf( _p_i )
 {
     /* We should use that one to take the more size it can */
-    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding);
+    //setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding);
 
     /* A dark background */
     setAutoFillBackground( true );
@@ -299,17 +299,14 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
     /* A cone in the middle */
     label = new QLabel;
     label->setMargin( 5 );
-/*    label->setMaximumHeight( MAX_BG_SIZE );
-    label->setMaximumWidth( MAX_BG_SIZE );
-    label->setMinimumHeight( MIN_BG_SIZE );
-    label->setMinimumWidth( MIN_BG_SIZE );*/
     label->setAlignment( Qt::AlignCenter );
-    if( QDate::currentDate().dayOfYear() >= 354 )
-        label->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) );
-    else
-        label->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
 
+    /* Init the cone art */
+    updateArt( "" );
+
+    /* Grid, because of the visual selector */
     QGridLayout *backgroundLayout = new QGridLayout( this );
+    backgroundLayout->setMargin( 0 );
     backgroundLayout->addWidget( label, 0, 1 );
     backgroundLayout->setColumnStretch( 0, 1 );
     backgroundLayout->setColumnStretch( 2, 1 );
@@ -318,9 +315,6 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
              this, updateArt( const QString& ) );
 }
 
-BackgroundWidget::~BackgroundWidget()
-{}
-
 void BackgroundWidget::resizeEvent( QResizeEvent * event )
 {
     if( event->size().height() <= MIN_BG_SIZE )
@@ -333,6 +327,7 @@ void BackgroundWidget::updateArt( const QString& url )
 {
     if( url.isEmpty() )
     {
+        /* Xmas joke */
         if( QDate::currentDate().dayOfYear() >= 354 )
             label->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) );
         else
index 9802b043a883f9ef4d5a487f2defef2559bd6155..4bda22b858ab36ea8097e3678886d93428cd8865 100644 (file)
@@ -91,7 +91,6 @@ class BackgroundWidget : public QWidget
     Q_OBJECT
 public:
     BackgroundWidget( intf_thread_t * );
-    virtual ~BackgroundWidget();
 
 private:
     QLabel *label;