Skip to content
Permalink
Browse files

rotated ticks folloup : improve UI

groupboxes, better labels, units prefixes
  • Loading branch information
olivierdalang authored and nyalldawson committed Oct 7, 2020
1 parent e298a08 commit 0b0f7d15ab5d5d095b48a77f36ceba5b98d4b9f6
@@ -63,11 +63,11 @@ QgsLayoutMapGridWidget::QgsLayoutMapGridWidget( QgsLayoutItemMapGrid *mapGrid, Q
connect( mFrameWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutMapGridWidget::mFrameWidthSpinBox_valueChanged );
connect( mGridFrameMarginSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutMapGridWidget::mGridFrameMarginSpinBox_valueChanged );
connect( mFrameStyleComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged );
connect( mRotatedTicksCheckBox, &QCheckBox::toggled, this, &QgsLayoutMapGridWidget::mRotatedTicksCheckBox_toggled );
connect( mRotatedTicksGroupBox, &QGroupBox::toggled, this, &QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled );
connect( mRotatedTicksLengthModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutMapGridWidget::mRotatedTicksLengthModeComboBox_currentIndexChanged );
connect( mRotatedTicksThresholdSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutMapGridWidget::mRotatedTicksThresholdSpinBox_valueChanged );
connect( mRotatedTicksMarginToCornerSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged );
connect( mRotatedAnnotationsCheckBox, &QCheckBox::toggled, this, &QgsLayoutMapGridWidget::mRotatedAnnotationsCheckBox_toggled );
connect( mRotatedAnnotationsGroupBox, &QGroupBox::toggled, this, &QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled );
connect( mRotatedAnnotationsLengthModeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutMapGridWidget::mRotatedAnnotationsLengthModeComboBox_currentIndexChanged );
connect( mRotatedAnnotationsThresholdSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutMapGridWidget::mRotatedAnnotationsThresholdSpinBox_valueChanged );
connect( mRotatedAnnotationsMarginToCornerSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutMapGridWidget::mRotatedAnnotationsMarginToCornerSpinBox_valueChanged );
@@ -347,7 +347,7 @@ void QgsLayoutMapGridWidget::toggleFrameControls( bool frameEnabled, bool frameF
mRightDivisionsLabel->setEnabled( frameEnabled );
mTopDivisionsLabel->setEnabled( frameEnabled );
mBottomDivisionsLabel->setEnabled( frameEnabled );
mRotatedTicksCheckBox->setEnabled( rotationEnabled );
mRotatedTicksGroupBox->setEnabled( rotationEnabled );
mRotatedTicksLengthModeComboBox->setEnabled( rotationEnabled );
mRotatedTicksThresholdSpinBox->setEnabled( rotationEnabled );
mRotatedTicksMarginToCornerSpinBox->setEnabled( rotationEnabled );
@@ -570,12 +570,12 @@ void QgsLayoutMapGridWidget::setGridItems()
mCheckGridTopSide->setChecked( mMapGrid->testFrameSideFlag( QgsLayoutItemMapGrid::FrameTop ) );
mCheckGridBottomSide->setChecked( mMapGrid->testFrameSideFlag( QgsLayoutItemMapGrid::FrameBottom ) );

mRotatedTicksCheckBox->setChecked( mMapGrid->rotatedTicksEnabled() );
mRotatedTicksGroupBox->setChecked( mMapGrid->rotatedTicksEnabled() );
mRotatedTicksLengthModeComboBox->setCurrentIndex( mRotatedTicksLengthModeComboBox->findData( mMapGrid->rotatedTicksLengthMode() ) );
mRotatedTicksThresholdSpinBox->setValue( mMapGrid->rotatedTicksMinimumAngle() );
mRotatedTicksMarginToCornerSpinBox->setValue( mMapGrid->rotatedTicksMarginToCorner() );

mRotatedAnnotationsCheckBox->setChecked( mMapGrid->rotatedAnnotationsEnabled() );
mRotatedAnnotationsGroupBox->setChecked( mMapGrid->rotatedAnnotationsEnabled() );
mRotatedAnnotationsLengthModeComboBox->setCurrentIndex( mRotatedAnnotationsLengthModeComboBox->findData( mMapGrid->rotatedAnnotationsLengthMode() ) );
mRotatedAnnotationsThresholdSpinBox->setValue( mMapGrid->rotatedAnnotationsMinimumAngle() );
mRotatedAnnotationsMarginToCornerSpinBox->setValue( mMapGrid->rotatedAnnotationsMarginToCorner() );
@@ -897,7 +897,7 @@ void QgsLayoutMapGridWidget::mFrameStyleComboBox_currentIndexChanged( int )
mMap->endCommand();
}

void QgsLayoutMapGridWidget::mRotatedTicksCheckBox_toggled( bool state )
void QgsLayoutMapGridWidget::mRotatedTicksGroupBox_toggled( bool state )
{
if ( !mMapGrid || !mMap )
{
@@ -950,7 +950,7 @@ void QgsLayoutMapGridWidget::mRotatedTicksMarginToCornerSpinBox_valueChanged( do
mMap->endCommand();
}

void QgsLayoutMapGridWidget::mRotatedAnnotationsCheckBox_toggled( bool state )
void QgsLayoutMapGridWidget::mRotatedAnnotationsGroupBox_toggled( bool state )
{
if ( !mMapGrid || !mMap )
{
@@ -50,11 +50,11 @@ class GUI_EXPORT QgsLayoutMapGridWidget: public QgsLayoutItemBaseWidget, private
void mOffsetYSpinBox_valueChanged( double value );
void mCrossWidthSpinBox_valueChanged( double val );
void mFrameWidthSpinBox_valueChanged( double val );
void mRotatedTicksCheckBox_toggled( bool checked );
void mRotatedTicksGroupBox_toggled( bool checked );
void mRotatedTicksLengthModeComboBox_currentIndexChanged( int );
void mRotatedTicksThresholdSpinBox_valueChanged( double val );
void mRotatedTicksMarginToCornerSpinBox_valueChanged( double val );
void mRotatedAnnotationsCheckBox_toggled( bool checked );
void mRotatedAnnotationsGroupBox_toggled( bool checked );
void mRotatedAnnotationsLengthModeComboBox_currentIndexChanged( int );
void mRotatedAnnotationsThresholdSpinBox_valueChanged( double val );
void mRotatedAnnotationsMarginToCornerSpinBox_valueChanged( double val );

0 comments on commit 0b0f7d1

Please sign in to comment.
You can’t perform that action at this time.