Skip to content
Permalink
Browse files

Address PR comments

  • Loading branch information
elpaso authored and nyalldawson committed Oct 6, 2020
1 parent 1836891 commit 5b3c283d35118fa1fe0944868fa7da3329cec23b
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/gui/raster/qgscolorrampshaderwidget.cpp
@@ -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()
@@ -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 );
}
}
}

0 comments on commit 5b3c283

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