[vlc-commits] commit: Qt: clean bgWidget (Jean-Baptiste Kempf )

git version control git at videolan.org
Thu Mar 4 22:59:37 CET 2010


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Mar  4 22:37:33 2010 +0100| [8fba1635ceca1efdb2c2b4ce2dc5d9261d4d1bfb] | committer: Jean-Baptiste Kempf 

Qt: clean bgWidget

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8fba1635ceca1efdb2c2b4ce2dc5d9261d4d1bfb
---

 modules/gui/qt4/components/interface_widgets.cpp |   23 ++++++++-------------
 modules/gui/qt4/components/interface_widgets.hpp |    1 -
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 932b6bf..cd1fb80 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -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 at 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
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index 9802b04..4bda22b 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -91,7 +91,6 @@ class BackgroundWidget : public QWidget
     Q_OBJECT
 public:
     BackgroundWidget( intf_thread_t * );
-    virtual ~BackgroundWidget();
 
 private:
     QLabel *label;



More information about the vlc-commits mailing list