]> git.sesse.net Git - vlc/commitdiff
Qt4 - Preferences - Size/Layout/Margin and stuff related. This is not yet optimal...
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 9 Apr 2007 22:57:52 +0000 (22:57 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 9 Apr 2007 22:57:52 +0000 (22:57 +0000)
modules/gui/qt4/components/complete_preferences.cpp
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/dialogs/preferences.cpp

index 8bbc1162b48d5125418891ebd33aecd8eb591e4f..a7217f2ec45bcd19130612b23c0cfd2c86b96315 100644 (file)
@@ -65,6 +65,8 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
     setAlternatingRowColors( true );
     header()->hide();
     setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
+    setTextElideMode( Qt::ElideNone );
+    setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
 
 #define BI( a,b) QIcon a##_icon = QIcon( QPixmap( b##_xpm ))
     BI( audio, audio );
@@ -372,6 +374,7 @@ PrefsPanel::PrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
     }
 
     global_layout = new QVBoxLayout();
+    global_layout->setMargin( 2 );
     QString head;
     if( data->i_type == TYPE_SUBCATEGORY || data->i_type ==  TYPE_CATSUBCAT )
     {
index 5e7944846a8fa5c61a7f076dd7b21ef49fa4c2a9..eef694ad8b5a253424cda601711f59a434bfe976 100644 (file)
@@ -82,9 +82,12 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent ) :
     ADD_CATEGORY( SPrefsHotkeys, qtr("Hotkeys"), spref_cone_Hotkeys_64.png, 5 );
 
     SPrefsInterface->setChecked( true );
+    layout->setMargin( 0 );
+    layout->setSpacing( 1 );
 
     this->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
     setLayout( layout );
+
 }
 
 void SPrefsCatList::switchPanel( int i )
@@ -142,6 +145,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
 
     QVBoxLayout *panel_layout = new QVBoxLayout();
     QWidget *panel = new QWidget();
+    panel_layout->setMargin( 3 );
 
     // Title Label
     QLabel *panel_label = new QLabel;
index 8346a4df90b2c75d765e38e499c01fc682b0ed00..72773e93fef3c9864d3f8156a06601854135d6b0 100644 (file)
@@ -44,68 +44,71 @@ PrefsDialog *PrefsDialog::instance = NULL;
 
 PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 {
-     QGridLayout *main_layout = new QGridLayout( this );
-     setWindowTitle( qtr( "Preferences" ) );
-     resize( 700, 650 );
-     setMaximumHeight( 650 );
-     setMaximumWidth( 700 );
+    QGridLayout *main_layout = new QGridLayout( this );
+    setWindowTitle( qtr( "Preferences" ) );
+    resize( 700, 650 );
 
-     /* Create Panels */
-     tree_panel = new QWidget( 0 );
-     tree_panel_l = new QHBoxLayout;
-     tree_panel->setLayout( tree_panel_l );
-     main_panel = new QWidget( 0 );
-     main_panel_l = new QHBoxLayout;
-     main_panel->setLayout( main_panel_l );
+    /* Create Panels */
+    tree_panel = new QWidget( 0 );
+    tree_panel_l = new QHBoxLayout;
+    tree_panel->setLayout( tree_panel_l );
+    main_panel = new QWidget( 0 );
+    main_panel_l = new QHBoxLayout;
+    main_panel->setLayout( main_panel_l );
 
-     /* Choice for types */
-     types = new QGroupBox( "Show settings" );
-     types->setAlignment( Qt::AlignHCenter );
-     QHBoxLayout *types_l = new QHBoxLayout(0);
-     types_l->setSpacing( 3 ); types_l->setMargin( 3 );
-     small = new QRadioButton( "Basic", types ); types_l->addWidget( small );
-     all = new QRadioButton( "All", types ); types_l->addWidget( all );
-     types->setLayout( types_l );
-     small->setChecked( true );
+    /* Choice for types */
+    types = new QGroupBox( "Show settings" );
+    types->setAlignment( Qt::AlignHCenter );
+    QHBoxLayout *types_l = new QHBoxLayout(0);
+    types_l->setSpacing( 3 ); types_l->setMargin( 3 );
+    small = new QRadioButton( "Basic", types ); types_l->addWidget( small );
+    all = new QRadioButton( "All", types ); types_l->addWidget( all );
+    types->setLayout( types_l );
+    small->setChecked( true );
 
-     /* Tree and panel initialisations */
-     advanced_tree = NULL;
-     simple_tree = NULL;
-     simple_panel = NULL;
-     advanced_panel = NULL;
+    /* Tree and panel initialisations */
+    advanced_tree = NULL;
+    simple_tree = NULL;
+    simple_panel = NULL;
+    advanced_panel = NULL;
 
-     main_layout->addWidget( tree_panel, 0, 0, 3, 1 );
-     main_layout->addWidget( types, 3, 0, 2, 1 );
+    /* Buttons */
+    QDialogButtonBox *buttonsBox = new QDialogButtonBox();
+    QPushButton *save = new QPushButton( qtr( "&Save" ) );
+    QPushButton *cancel = new QPushButton( qtr( "&Cancel" ) );
+    QPushButton *reset = new QPushButton( qtr( "&Reset Preferences" ) );
 
-     main_layout->addWidget( main_panel, 0, 1, 4, 1 );
+    buttonsBox->addButton( save, QDialogButtonBox::AcceptRole );
+    buttonsBox->addButton( cancel, QDialogButtonBox::RejectRole );
+    buttonsBox->addButton( reset, QDialogButtonBox::ActionRole );
 
-     main_layout->setColumnMinimumWidth( 0, 150 );
-     main_layout->setColumnStretch( 0, 1 );
-     main_layout->setColumnStretch( 1, 3 );
+    /* Layout  */
+    main_layout->addWidget( tree_panel, 0, 0, 3, 1 );
+    main_layout->addWidget( types, 3, 0, 2, 1 );
+    main_layout->addWidget( main_panel, 0, 1, 4, 1 );
+    main_layout->addWidget( buttonsBox, 4, 1, 1 ,2 );
 
-     main_layout->setRowStretch( 2, 4);
+    main_layout->setColumnMinimumWidth( 0, 150 );
+    main_layout->setColumnStretch( 0, 1 );
+    main_layout->setColumnStretch( 1, 3 );
 
-     setSmall();
+    main_layout->setRowStretch( 2, 4);
 
-     QDialogButtonBox *buttonsBox = new QDialogButtonBox();
-     QPushButton *save = new QPushButton( qtr( "&Save" ) );
-     QPushButton *cancel = new QPushButton( qtr( "&Cancel" ) );
-     QPushButton *reset = new QPushButton( qtr( "&Reset Preferences" ) );
+    setLayout( main_layout );
 
-     buttonsBox->addButton( save, QDialogButtonBox::AcceptRole );
-     buttonsBox->addButton( cancel, QDialogButtonBox::RejectRole );
-     buttonsBox->addButton( reset, QDialogButtonBox::ActionRole );
+    /* Margins */
+    tree_panel_l->setMargin( 1 );
+    main_panel_l->setMargin( 3 );
 
-     main_layout->addWidget( buttonsBox, 4, 1, 1 ,2 );
-     setLayout( main_layout );
+    setSmall();
 
-     BUTTONACT( save, save() );
-     BUTTONACT( cancel, cancel() );
-     BUTTONACT( reset, reset() );
-     BUTTONACT( small, setSmall() );
-     BUTTONACT( all, setAll() );
+    BUTTONACT( save, save() );
+    BUTTONACT( cancel, cancel() );
+    BUTTONACT( reset, reset() );
+    BUTTONACT( small, setSmall() );
+    BUTTONACT( all, setAll() );
 
-     for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
+    for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
 }
 
 void PrefsDialog::setAll()
@@ -268,7 +271,6 @@ void PrefsDialog::reset()
     if ( ret == QMessageBox::Ok )
     {
         config_ResetAll( p_intf );
-        // TODO reset changes ?
         config_SaveConfigFile( p_intf, NULL );
     }
 }