Skip to content

Commit

Permalink
[gui] improve scale widget layout to save space (#3243)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored and m-kuhn committed Jun 27, 2016
1 parent 4080aad commit 7b1ee07
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/gui/qgsscalerangewidget.cpp
Expand Up @@ -25,12 +25,12 @@ QgsScaleRangeWidget::QgsScaleRangeWidget( QWidget *parent )
mLayout = new QGridLayout( this );
mLayout->setContentsMargins( 0, 0, 0, 0 );

QLabel* minLbl = new QLabel( tr( "Minimum\n(exclusive)" ), this );
QLabel* minLbl = new QLabel( tr( "Minimum (exclusive)" ), this );
minLbl->setWordWrap( true );
minLbl->setAlignment( Qt::AlignTop );
minLbl->setToolTip( tr( "Minimum scale, i.e. maximum scale denominator. "
"This limit is exclusive, that means the layer will not be displayed on this scale." ) );
QLabel* maxLbl = new QLabel( tr( "Maximum\n(inclusive)" ), this );
QLabel* maxLbl = new QLabel( tr( "Maximum (inclusive)" ), this );
maxLbl->setWordWrap( true );
maxLbl->setAlignment( Qt::AlignTop );
maxLbl->setToolTip( tr( "Maximum scale, i.e. minimum scale denominator. "
Expand All @@ -51,19 +51,17 @@ QgsScaleRangeWidget::QgsScaleRangeWidget( QWidget *parent )
mMinimumScaleWidget->setScale( 1.0 / 100000 );
mMaximumScaleWidget->setScale( 1.0 / 1000 );

mLayout->addWidget( minLbl, 0, 0, 2, 1 );
mLayout->addWidget( mMinimumScaleIconLabel, 0, 1 );
mLayout->addWidget( mMinimumScaleWidget, 0, 2 );
mLayout->addWidget( maxLbl, 0, 3, 2, 1 );
mLayout->addWidget( mMaximumScaleIconLabel, 0, 4 );
mLayout->addWidget( mMaximumScaleWidget, 0, 5 );
mLayout->addWidget( minLbl, 0, 0, 1, 2 );
mLayout->addWidget( mMinimumScaleIconLabel, 1, 0 );
mLayout->addWidget( mMinimumScaleWidget, 1, 1 );
mLayout->addWidget( maxLbl, 0, 2, 1, 2 );
mLayout->addWidget( mMaximumScaleIconLabel, 1, 2 );
mLayout->addWidget( mMaximumScaleWidget, 1, 3 );

mLayout->setColumnStretch( 0, 0 );
mLayout->setColumnStretch( 1, 0 );
mLayout->setColumnStretch( 2, 3 );
mLayout->setColumnStretch( 3, 0 );
mLayout->setColumnStretch( 4, 0 );
mLayout->setColumnStretch( 5, 3 );
mLayout->setColumnStretch( 1, 3 );
mLayout->setColumnStretch( 2, 0 );
mLayout->setColumnStretch( 3, 3 );

connect( mMinimumScaleWidget, SIGNAL( scaleChanged( double ) ), this, SLOT( emitRangeChanged() ) );
connect( mMaximumScaleWidget, SIGNAL( scaleChanged( double ) ), this, SLOT( emitRangeChanged() ) );
Expand Down

0 comments on commit 7b1ee07

Please sign in to comment.