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