[TD] sanitize Scale preferences

- take care that custom scale is only in effect if the scale type is 'Custom'
- use UnitSpinBox for Template Mark
- use uniform width for all scale edits
- also use UnitSpinBox for Balloon Kink
This commit is contained in:
donovaly
2020-03-15 02:30:11 +01:00
committed by WandererFan
parent 0cc3a2778b
commit 80e26b01a3
5 changed files with 316 additions and 273 deletions

View File

@@ -34,8 +34,10 @@ DlgPrefsTechDraw2Imp::DlgPrefsTechDraw2Imp( QWidget* parent )
: PreferencePage( parent )
{
this->setupUi(this);
// pdsbTemplateMark->setUnit(Base::Unit::Length);
this->pdsbTemplateMark->setUnit(Base::Unit::Length);
connect(this->cbViewScaleType, SIGNAL(currentIndexChanged(int)),
this, SLOT(onScaleTypeChanged(int)));
}
DlgPrefsTechDraw2Imp::~DlgPrefsTechDraw2Imp()
@@ -43,6 +45,16 @@ DlgPrefsTechDraw2Imp::~DlgPrefsTechDraw2Imp()
// no need to delete child widgets, Qt does it all for us
}
void DlgPrefsTechDraw2Imp::onScaleTypeChanged(int index)
{
// disable custom scale if the scale type is not custom
if (index == 2) // if custom
this->pdsbViewScale->setEnabled(true);
else
this->pdsbViewScale->setEnabled(false);
}
void DlgPrefsTechDraw2Imp::saveSettings()
{
pdsbToleranceScale->onSave();