Commit 4e7e655a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Preferences - Size/Layout/Margin and stuff related. This is not yet...

Qt4 - Preferences - Size/Layout/Margin and stuff related. This is not yet optimal, but is much better than it was, I think. Some work has yet to be done on Complete Preferences to make it nicer.


parent 55b8d4f9
......@@ -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 )
{
......
......@@ -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;
......
......@@ -47,8 +47,6 @@ 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 );
/* Create Panels */
tree_panel = new QWidget( 0 );
......@@ -74,10 +72,21 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
simple_panel = NULL;
advanced_panel = NULL;
/* Buttons */
QDialogButtonBox *buttonsBox = new QDialogButtonBox();
QPushButton *save = new QPushButton( qtr( "&Save" ) );
QPushButton *cancel = new QPushButton( qtr( "&Cancel" ) );
QPushButton *reset = new QPushButton( qtr( "&Reset Preferences" ) );
buttonsBox->addButton( save, QDialogButtonBox::AcceptRole );
buttonsBox->addButton( cancel, QDialogButtonBox::RejectRole );
buttonsBox->addButton( reset, QDialogButtonBox::ActionRole );
/* 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->setColumnMinimumWidth( 0, 150 );
main_layout->setColumnStretch( 0, 1 );
......@@ -85,19 +94,13 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
main_layout->setRowStretch( 2, 4);
setSmall();
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() );
......@@ -268,7 +271,6 @@ void PrefsDialog::reset()
if ( ret == QMessageBox::Ok )
{
config_ResetAll( p_intf );
// TODO reset changes ?
config_SaveConfigFile( p_intf, NULL );
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment