From: Juergen Spitzmueller Date: Fri, 26 Jun 2015 11:19:12 +0000 (+0200) Subject: HSpace/VSpace: use a _signed_ length validator in the dialogs. X-Git-Tag: 2.2.0alpha1~490 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2a8db0a64bd40ed1c91ab93297cb0fff78f71bde;p=lyx.git HSpace/VSpace: use a _signed_ length validator in the dialogs. --- diff --git a/src/frontends/qt4/GuiHSpace.cpp b/src/frontends/qt4/GuiHSpace.cpp index 93de4bb695..ad829ecd81 100644 --- a/src/frontends/qt4/GuiHSpace.cpp +++ b/src/frontends/qt4/GuiHSpace.cpp @@ -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); diff --git a/src/frontends/qt4/GuiVSpace.cpp b/src/frontends/qt4/GuiVSpace.cpp index 4ac4c69b82..6eec95846b 100644 --- a/src/frontends/qt4/GuiVSpace.cpp +++ b/src/frontends/qt4/GuiVSpace.cpp @@ -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);