]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.cpp
Qt4 - Make the interface a bit smaller.
[vlc] / modules / gui / qt4 / components / interface_widgets.cpp
index f9fe06a84c6082016d70c727565759fab1833549..f78e9fda278171600e4b39ceefeb8edca6c16466 100644 (file)
@@ -55,9 +55,10 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
 {
     vlc_mutex_init( p_intf, &lock );
     p_vout = NULL;
-
-    CONNECT( this, askResize(), this, SetMinSize() );
-    CONNECT( this, askVideoToShow(), this, show() );
+    hide(); setMinimumSize( 16, 16 );
+   // CONNECT( this, askResize( int, int ), this, SetSizing( int, int ) );
+    CONNECT( this, askVideoWidgetToShow(), this, show() );
     setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
 }
 
@@ -86,23 +87,29 @@ QSize VideoWidget::sizeHint() const
     return widgetSize;
 }
 
+/**
+ * Request the video to avoid the conflicts 
+ **/
 void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
                            unsigned int *pi_width, unsigned int *pi_height )
 {
-    emit askVideoToShow();
+    emit askVideoWidgetToShow();
     if( p_vout )
     {
         msg_Dbg( p_intf, "embedded video already in use" );
         return NULL;
     }
     p_vout = p_nvout;
-    emit askResize();
     return ( void* )winId();
 }
 
-void VideoWidget::SetMinSize()
+/* Set the Widget to the correct Size */
+void VideoWidget::SetSizing( unsigned int w, unsigned int h )
 {
-    setMinimumSize( 16, 16 );
+    resize( w, h );
+    //updateGeometry(); // Needed for deinterlace
+    msg_Dbg( p_intf, "%i %i", sizeHint().height(), sizeHint().width() );
+    emit askResize();
 }
 
 void VideoWidget::release( void *p_win )
@@ -371,7 +378,11 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
 {
     controlLayout = new QGridLayout( this );
     controlLayout->setSpacing( 0 );
-    //controlLayout->setMargin( 0 );
+#if QT43
+    controlLayout->setContentsMargins( 9, 6, 9, 6 );
+#else
+    controlLayout->setMargin( 6 );
+#endif
 
     setSizePolicy( QSizePolicy::Preferred , QSizePolicy::Maximum );
 
@@ -505,6 +516,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     controlLayout->setColumnStretch( 7, 0 );
     controlLayout->setColumnStretch( 8, 0 );
     controlLayout->setColumnStretch( 9, 0 );
+
     /*
      * Other first Line buttons
      */
@@ -529,6 +541,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
     controlLayout->addWidget( extSettingsButton, 3, 12, Qt::AlignBottom );
 
     controlLayout->setColumnStretch( 13, 0 );
+    controlLayout->setColumnMinimumWidth( 13, 24 );
     controlLayout->setColumnStretch( 14, 5 );
 
     /* Volume */
@@ -561,7 +574,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
                               VOLUME_MAX / (AOUT_VOLUME_MAX/2) );
 
     /* Volume control connection */
-    resize( QSize( 400, 60 ) );
+    //resize( QSize( 300, 60 ) );
     CONNECT( volumeSlider, valueChanged( int ), this, updateVolume( int ) );
     msg_Dbg( p_intf, "controls size: %i - %i", size().width(), size().height() );
 }