]> git.sesse.net Git - vlc/commitdiff
Qt4 - small fixes... Remove one redondant connect, block the access to the speedSlide...
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 12 Feb 2008 08:33:39 +0000 (08:33 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 12 Feb 2008 08:33:39 +0000 (08:33 +0000)
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/main_interface.cpp

index 06e33aca411d9862ad5ddd6e0808d459e0dbd82e..0418cf4430360eaead2c1b4ab5fcc18dbfa99898 100644 (file)
@@ -148,11 +148,11 @@ QSize VideoWidget::sizeHint() const
 #define MAX_BG_SIZE 400
 #define MIN_BG_SIZE 64
 
-BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) :
-                                        QWidget( NULL ), p_intf( _p_i )
+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::Preferred, QSizePolicy::Preferred );
+//    setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
 
     /* A dark background */
     setAutoFillBackground( true );
@@ -179,13 +179,20 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i ) :
     backgroundLayout->setColumnStretch( 2, 1 );
 
     CONNECT( THEMIM->getIM(), artChanged( QString ), this, update( QString ) );
-    resize( 300, 150 );
 }
 
 BackgroundWidget::~BackgroundWidget()
 {
 }
 
+void BackgroundWidget::resizeEvent( QResizeEvent * event )
+{
+    if( event->size().height() <= MIN_BG_SIZE )
+        label->hide();
+    else
+        label->show();
+}
+
 void BackgroundWidget::update( QString url )
 {
     if( url.isNull() )
@@ -613,7 +620,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
     CONNECT( THEMIM, volumeChanged( void ), this, updateVolume( void ) );
 
-    CONNECT( THEMIM->getIM(), statusChanged( int ), this, updateInput() );
 
     updateInput();
 }
@@ -828,6 +834,11 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i ) :
 SpeedControlWidget::~SpeedControlWidget()
 {}
 
+void SpeedControlWidget::setEnable( bool b_enable )
+{
+    speedSlider->setEnabled( b_enable );
+}
+
 void SpeedControlWidget::mouseDoubleClickEvent( QMouseEvent * event )
 {
     resetRate();
index ce8e31d962c5ac7ec4afbd1318e9f5142cc2efce..ba82a6068736e3164a5560cba84225f14f947ef7 100644 (file)
@@ -91,7 +91,7 @@ private:
     QLabel *label;
     virtual void contextMenuEvent( QContextMenuEvent *event );
     intf_thread_t *p_intf;
-
+    virtual void resizeEvent( QResizeEvent * event );
 public slots:
     void toggle(){ TOGGLEV( this ); }
     void update( QString );
@@ -252,6 +252,8 @@ protected:
 private:
     intf_thread_t *p_intf;
     QSlider *speedSlider;
+public slots:
+    void setEnable( bool );
 private slots:
     void updateRate( int );
     void resetRate();
index 63fbe6f133485e0efdafd63b83675d72bf8726e4..ab5ec4ab1644c877295346fe87acca6a74d134ca 100644 (file)
@@ -904,6 +904,10 @@ void MainInterface::setStatus( int status )
 {
     /* Forward the status to the controls to toggle Play/Pause */
     controls->setStatus( status );
+
+    controls->updateInput();
+    speedControl->setEnable( THEMIM->getIM()->hasInput() );
+
     /* And in the systray for the menu */
     if( sysTray )
         QVLCMenu::updateSystrayMenu( this, p_intf );