Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Oct 6, 2020
1 parent 1836891 commit 5b3c283
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/gui/raster/qgscolorrampshaderwidget.cpp
Expand Up @@ -102,7 +102,10 @@ QgsColorRampShaderWidget::QgsColorRampShaderWidget( QWidget *parent )
connect( btnColorRamp, &QgsColorRampButton::colorRampChanged, this, &QgsColorRampShaderWidget::applyColorRamp );
connect( mNumberOfEntriesSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsColorRampShaderWidget::classify );
connect( mClipCheckBox, &QAbstractButton::toggled, this, &QgsColorRampShaderWidget::widgetChanged );
connect( mLabelPrecisionSpinBox, qgis::overload<int>::of( &QSpinBox::valueChanged ), this, [ = ]( int ) { autoLabel(); } );
connect( mLabelPrecisionSpinBox, qgis::overload<int>::of( &QSpinBox::valueChanged ), this, [ = ]( int )
{
autoLabel();
} );
}

void QgsColorRampShaderWidget::initializeForUseWithRasterLayer()
Expand All @@ -124,13 +127,7 @@ void QgsColorRampShaderWidget::setRasterBand( int band )
if ( mRasterDataProvider )
{
const int maxDigits { QgsGuiUtils::significantDigits( mRasterDataProvider->dataType( mBand ) ) };
// Get current value
const int currentPrecision { mLabelPrecisionSpinBox->value() };
mLabelPrecisionSpinBox->setMaximum( maxDigits );
if ( currentPrecision > maxDigits )
{
mLabelPrecisionSpinBox->setValue( maxDigits );
}
}
}

Expand Down

0 comments on commit 5b3c283

Please sign in to comment.