[locale] Shuffle code
- Put the building-up-the-overall-page in one spot - Claim a little more vertical space for the TZ widget
This commit is contained in:
parent
c0be53523c
commit
ade623f6b8
@ -49,35 +49,32 @@ LocalePage::LocalePage( QWidget* parent )
|
|||||||
QBoxLayout* mainLayout = new QVBoxLayout;
|
QBoxLayout* mainLayout = new QVBoxLayout;
|
||||||
|
|
||||||
QBoxLayout* tzwLayout = new QHBoxLayout;
|
QBoxLayout* tzwLayout = new QHBoxLayout;
|
||||||
mainLayout->addLayout( tzwLayout );
|
|
||||||
m_tzWidget = new TimeZoneWidget( this );
|
m_tzWidget = new TimeZoneWidget( this );
|
||||||
tzwLayout->addStretch();
|
tzwLayout->addStretch();
|
||||||
tzwLayout->addWidget( m_tzWidget );
|
tzwLayout->addWidget( m_tzWidget );
|
||||||
tzwLayout->addStretch();
|
tzwLayout->addStretch();
|
||||||
setMinimumWidth( m_tzWidget->width() );
|
// Adjust for margins and spacing in this page
|
||||||
|
m_tzWidget->setMinimumHeight( m_tzWidget->minimumHeight() + 12 ); // 2 * spacing
|
||||||
QBoxLayout* bottomLayout = new QHBoxLayout;
|
|
||||||
mainLayout->addLayout( bottomLayout );
|
|
||||||
|
|
||||||
|
QBoxLayout* zoneAndRegionLayout = new QHBoxLayout;
|
||||||
m_regionLabel = new QLabel( this );
|
m_regionLabel = new QLabel( this );
|
||||||
bottomLayout->addWidget( m_regionLabel );
|
zoneAndRegionLayout->addWidget( m_regionLabel );
|
||||||
|
|
||||||
m_regionCombo = new QComboBox( this );
|
m_regionCombo = new QComboBox( this );
|
||||||
bottomLayout->addWidget( m_regionCombo );
|
zoneAndRegionLayout->addWidget( m_regionCombo );
|
||||||
m_regionCombo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
m_regionCombo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
m_regionLabel->setBuddy( m_regionCombo );
|
m_regionLabel->setBuddy( m_regionCombo );
|
||||||
|
|
||||||
bottomLayout->addSpacing( 20 );
|
zoneAndRegionLayout->addSpacing( 20 );
|
||||||
|
|
||||||
m_zoneLabel = new QLabel( this );
|
m_zoneLabel = new QLabel( this );
|
||||||
bottomLayout->addWidget( m_zoneLabel );
|
zoneAndRegionLayout->addWidget( m_zoneLabel );
|
||||||
|
|
||||||
m_zoneCombo = new QComboBox( this );
|
m_zoneCombo = new QComboBox( this );
|
||||||
m_zoneCombo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
m_zoneCombo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
bottomLayout->addWidget( m_zoneCombo );
|
zoneAndRegionLayout->addWidget( m_zoneCombo );
|
||||||
m_zoneLabel->setBuddy( m_zoneCombo );
|
m_zoneLabel->setBuddy( m_zoneCombo );
|
||||||
|
|
||||||
mainLayout->addStretch();
|
|
||||||
|
|
||||||
QBoxLayout* localeLayout = new QHBoxLayout;
|
QBoxLayout* localeLayout = new QHBoxLayout;
|
||||||
m_localeLabel = new QLabel( this );
|
m_localeLabel = new QLabel( this );
|
||||||
@ -88,7 +85,6 @@ LocalePage::LocalePage( QWidget* parent )
|
|||||||
m_localeChangeButton = new QPushButton( this );
|
m_localeChangeButton = new QPushButton( this );
|
||||||
m_localeChangeButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
m_localeChangeButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
||||||
localeLayout->addWidget( m_localeChangeButton );
|
localeLayout->addWidget( m_localeChangeButton );
|
||||||
mainLayout->addLayout( localeLayout );
|
|
||||||
|
|
||||||
QBoxLayout* formatsLayout = new QHBoxLayout;
|
QBoxLayout* formatsLayout = new QHBoxLayout;
|
||||||
m_formatsLabel = new QLabel( this );
|
m_formatsLabel = new QLabel( this );
|
||||||
@ -99,8 +95,14 @@ LocalePage::LocalePage( QWidget* parent )
|
|||||||
m_formatsChangeButton = new QPushButton( this );
|
m_formatsChangeButton = new QPushButton( this );
|
||||||
m_formatsChangeButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
m_formatsChangeButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
||||||
formatsLayout->addWidget( m_formatsChangeButton );
|
formatsLayout->addWidget( m_formatsChangeButton );
|
||||||
mainLayout->addLayout( formatsLayout );
|
|
||||||
|
|
||||||
|
mainLayout->addLayout( tzwLayout );
|
||||||
|
mainLayout->addStretch();
|
||||||
|
mainLayout->addLayout( zoneAndRegionLayout );
|
||||||
|
mainLayout->addStretch();
|
||||||
|
mainLayout->addLayout( localeLayout );
|
||||||
|
mainLayout->addLayout( formatsLayout );
|
||||||
|
setMinimumWidth( m_tzWidget->width() );
|
||||||
setLayout( mainLayout );
|
setLayout( mainLayout );
|
||||||
|
|
||||||
connect( m_regionCombo, QOverload< int >::of( &QComboBox::currentIndexChanged ), this, &LocalePage::regionChanged );
|
connect( m_regionCombo, QOverload< int >::of( &QComboBox::currentIndexChanged ), this, &LocalePage::regionChanged );
|
||||||
|
Loading…
Reference in New Issue
Block a user