]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/extended.cpp
Qt: standardbuttons are bad for win32 and translation. Only use custom
[vlc] / modules / gui / qt4 / dialogs / extended.cpp
index 87cfff67886c882028ffc39792ccf1cc75db450c..11342f15e75baa32afea0eade5de3aea03fd0af6 100644 (file)
 
 #include <QTabWidget>
 #include <QGridLayout>
+#include <QDialogButtonBox>
+#include <QPushButton>
+#include <vlc_modules.h>
 
 ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
 {
     setWindowFlags( Qt::Tool );
-    setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) );
+    setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) );
     setWindowTitle( qtr( "Adjustments and Effects" ) );
     setWindowRole( "vlc-extended" );
 
-    QGridLayout *layout = new QGridLayout( this );
+    QVBoxLayout *layout = new QVBoxLayout( this );
     layout->setContentsMargins( 0, 2, 0, 1 );
     layout->setSpacing( 3 );
 
@@ -54,6 +57,9 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
     equal = new Equalizer( p_intf, audioTab );
     audioTab->addTab( equal, qtr( "Graphic Equalizer" ) );
 
+    Compressor *compres = new Compressor( p_intf, audioTab );
+    audioTab->addTab( compres, qtr( "Compressor" ) );
+
     Spatializer *spatial = new Spatializer( p_intf, audioTab );
     audioTab->addTab( spatial, qtr( "Spatializer" ) );
     audioLayout->addWidget( audioTab );
@@ -80,19 +86,21 @@ ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
         mainTabW->addTab( v4l2, qtr( "v4l2 controls" ) );
     }
 
-    layout->addWidget( mainTabW, 0, 0, 1, 5 );
+    layout->addWidget( mainTabW );
 
-    QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
-    layout->addWidget( closeButton, 1, 4, 1, 1 );
-    CONNECT( closeButton, clicked(), this, close() );
+    QDialogButtonBox *closeButtonBox = new QDialogButtonBox( Qt::Horizontal, this );
+    closeButtonBox->addButton(
+        new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole );
+    layout->addWidget( closeButtonBox );
+    CONNECT( closeButtonBox, rejected(), this, close() );
 
     /* Restore geometry or move this dialog on the left pane of the MI */
-    if( !restoreGeometry(getSettings()->value("EPanel/geometry").toByteArray()))
+    if( !restoreGeometry( getSettings()->value("EPanel/geometry").toByteArray() ) )
     {
         resize( QSize( 400, 280 ) );
 
         MainInterface *p_mi = p_intf->p_sys->p_mi;
-        if( p_mi )
+        if( p_mi && p_mi->x() > 50 )
             move( ( p_mi->x() - frameGeometry().width() - 10 ), p_mi->y() );
         else
             move ( 450 , 0 );