Skip to content
Permalink
Browse files

Show a nicer specific assistant widget when setting data defined opac…

…ity via assistant
  • Loading branch information
nyalldawson committed Nov 18, 2020
1 parent cc33ba7 commit bcc881611dd21d52dc9b23c36a27ab854c49b67e
Showing with 45 additions and 21 deletions.
  1. +45 −21 src/gui/qgspropertyassistantwidget.cpp
@@ -529,28 +529,52 @@ QgsPropertyGenericNumericAssistantWidget::QgsPropertyGenericNumericAssistantWidg

nullOutputSpinBox->setShowClearButton( false );

if ( definition.standardTemplate() == QgsPropertyDefinition::Rotation )
{
// tweak dialog for rotation
minOutputSpinBox->setMaximum( 360.0 );
minOutputSpinBox->setValue( 0.0 );
minOutputSpinBox->setShowClearButton( true );
minOutputSpinBox->setClearValue( 0.0 );
minOutputSpinBox->setSuffix( tr( " °" ) );
maxOutputSpinBox->setMaximum( 360.0 );
maxOutputSpinBox->setValue( 360.0 );
maxOutputSpinBox->setShowClearButton( true );
maxOutputSpinBox->setClearValue( 360.0 );
maxOutputSpinBox->setSuffix( tr( " °" ) );
exponentSpinBox->hide();
mExponentLabel->hide();
mLabelMinOutput->setText( tr( "Angle from" ) );
mLabelNullOutput->setText( tr( "Angle when NULL" ) );
}
else
switch ( definition.standardTemplate() )
{
minOutputSpinBox->setShowClearButton( false );
maxOutputSpinBox->setShowClearButton( false );
case QgsPropertyDefinition::Rotation:
{
// tweak dialog for rotation
minOutputSpinBox->setMaximum( 360.0 );
minOutputSpinBox->setValue( 0.0 );
minOutputSpinBox->setShowClearButton( true );
minOutputSpinBox->setClearValue( 0.0 );
minOutputSpinBox->setSuffix( tr( " °" ) );
maxOutputSpinBox->setMaximum( 360.0 );
maxOutputSpinBox->setValue( 360.0 );
maxOutputSpinBox->setShowClearButton( true );
maxOutputSpinBox->setClearValue( 360.0 );
maxOutputSpinBox->setSuffix( tr( " °" ) );
exponentSpinBox->hide();
mExponentLabel->hide();
mLabelMinOutput->setText( tr( "Angle from" ) );
mLabelNullOutput->setText( tr( "Angle when NULL" ) );
break;
}

case QgsPropertyDefinition::Opacity:
{
// tweak dialog for opacity
minOutputSpinBox->setMaximum( 100.0 );
minOutputSpinBox->setValue( 0.0 );
minOutputSpinBox->setShowClearButton( true );
minOutputSpinBox->setClearValue( 0.0 );
minOutputSpinBox->setSuffix( tr( " %" ) );
maxOutputSpinBox->setMaximum( 100.0 );
maxOutputSpinBox->setValue( 100.0 );
maxOutputSpinBox->setShowClearButton( true );
maxOutputSpinBox->setClearValue( 100.0 );
maxOutputSpinBox->setSuffix( tr( " %" ) );
mLabelMinOutput->setText( tr( "Opacity from" ) );
mLabelNullOutput->setText( tr( "Opacity when NULL" ) );
break;
}

default:
{
minOutputSpinBox->setShowClearButton( false );
maxOutputSpinBox->setShowClearButton( false );
break;
}
}

if ( const QgsGenericNumericTransformer *transform = dynamic_cast< const QgsGenericNumericTransformer * >( initialState.transformer() ) )

0 comments on commit bcc8816

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