diff --git a/glabels/EditVariableDialog.cpp b/glabels/EditVariableDialog.cpp index 4a1135e..9893da4 100644 --- a/glabels/EditVariableDialog.cpp +++ b/glabels/EditVariableDialog.cpp @@ -67,6 +67,8 @@ namespace glabels { incrementCombo->addItem( model::Variable::incrementToI18nString( type ) ); } + + stepSizeEdit->setText( "1" ); } @@ -157,28 +159,16 @@ namespace glabels case model::Variable::Type::INTEGER: valueEdit->setValidator( new QIntValidator() ); stepSizeEdit->setValidator( new QIntValidator() ); - - if ( increment == model::Variable::Increment::NEVER ) - { - stepSizeEdit->setText( "0" ); - } break; case model::Variable::Type::FLOATING_POINT: valueEdit->setValidator( new QDoubleValidator() ); stepSizeEdit->setValidator( new QDoubleValidator() ); - - if ( increment == model::Variable::Increment::NEVER ) - { - stepSizeEdit->setText( "0" ); - } break; default: valueEdit->setValidator( nullptr ); stepSizeEdit->setValidator( nullptr ); - incrementCombo->setCurrentIndex( static_cast(model::Variable::Increment::NEVER) ); - stepSizeEdit->setText( "" ); break; } @@ -186,8 +176,7 @@ namespace glabels bool isNumeric = ( type == model::Variable::Type::INTEGER ) || ( type == model::Variable::Type::FLOATING_POINT ); - incrementLabel->setEnabled( isNumeric ); - incrementCombo->setEnabled( isNumeric ); + incrementGroup->setVisible( isNumeric ); stepSizeLabel->setEnabled( isNumeric && (increment != model::Variable::Increment::NEVER) ); stepSizeEdit->setEnabled( isNumeric && (increment != model::Variable::Increment::NEVER) ); diff --git a/glabels/VariablesView.cpp b/glabels/VariablesView.cpp index 9487085..339d901 100644 --- a/glabels/VariablesView.cpp +++ b/glabels/VariablesView.cpp @@ -126,7 +126,7 @@ namespace glabels "x", "0", model::Variable::Increment::NEVER, - "0" ); + "1" ); dialog.setVariable( v ); dialog.setWindowTitle( tr("Add Variable") ); diff --git a/glabels/ui/EditVariableDialog.ui b/glabels/ui/EditVariableDialog.ui index af81a20..77b5e93 100644 --- a/glabels/ui/EditVariableDialog.ui +++ b/glabels/ui/EditVariableDialog.ui @@ -6,73 +6,44 @@ 0 0 - 471 - 237 + 469 + 297 Dialog - - - - - - Variable type: - - - - - - - - - - Name: - - - - - - - - - - Initial value: - - - - - - - - - - Increment: - - - - - - - - - - - - Step size: - - - - - - - - - + + 12 + + + + + Increment + + + + + + + + + + + Step size: + + + + + + + + + + - + Qt::Vertical @@ -85,7 +56,50 @@ - + + + + Variable + + + + + + + + + + + Type: + + + + + + + + + + Value: + + + + + + + Name: + + + + + + + + + + + + Qt::Horizontal diff --git a/translations/glabels_C.ts b/translations/glabels_C.ts index 10ece40..a81f287 100644 --- a/translations/glabels_C.ts +++ b/translations/glabels_C.ts @@ -184,26 +184,30 @@ Dialog - - Variable type: - - Name: - - Initial value: - - - - Increment: - - Step size: + + Increment + + + + Variable + + + + Type: + + + + Value: + + Factory