HSpace/VSpace: use a _signed_ length validator in the dialogs.

This commit is contained in:
Juergen Spitzmueller 2015-06-26 13:19:12 +02:00
parent 5e7cbc8f2c
commit 2a8db0a64b
2 changed files with 9 additions and 3 deletions

View File

@ -81,10 +81,13 @@ GuiHSpace::GuiHSpace(bool math_mode, QWidget * parent)
connect(fillPatternCO, SIGNAL(activated(int)),
this, SLOT(changedSlot()));
// Set up a signed (glue) length validator
LengthValidator * v = new LengthValidator(valueLE);
if (math_mode_)
valueLE->setValidator(unsignedLengthValidator(valueLE));
v->setBottom(Length());
else
valueLE->setValidator(unsignedGlueLengthValidator(valueLE));
v->setBottom(GlueLength());
valueLE->setValidator(v);
// initialize the length validator
addCheckedWidget(valueLE, valueL);

View File

@ -53,7 +53,10 @@ GuiVSpace::GuiVSpace(QWidget * parent) : InsetParamsWidget(parent)
connect(spacingCO, SIGNAL(activated(int)),
this, SLOT(enableCustom(int)));
valueLE->setValidator(unsignedGlueLengthValidator(valueLE));
// Set up a signed glue length validator
LengthValidator * v = new LengthValidator(valueLE);
v->setBottom(GlueLength());
valueLE->setValidator(v);
// initialize the length validator
addCheckedWidget(valueLE, valueL);