GuiParagraph: Fix remaining glitch when entering custom line spread

while immediate apply is activated.
This commit is contained in:
Juergen Spitzmueller 2015-06-13 12:31:03 +02:00
parent 930fef9d8d
commit f0923ebadc

View File

@ -270,26 +270,37 @@ void GuiParagraph::updateView()
// linespacing // linespacing
int ls; int ls;
bool pending_input = false;
Spacing const & space = pp.spacing(); Spacing const & space = pp.spacing();
switch (space.getSpace()) { if (synchronizedViewCB->isChecked() && linespacingValue->hasFocus()) {
case Spacing::Single: // The user is about to enter custom spacing.
ls = 1; // We thus stay in Custom mode.
break; // This prevents the combo from e.g. immediately
case Spacing::Onehalf: // switching to single if a user enters "1" in the
ls = 2; // linespacingValue widget while aiming at e.g. "1.3"
break;
case Spacing::Double:
ls = 3;
break;
case Spacing::Other:
ls = 4; ls = 4;
break; pending_input = true;
default: } else {
ls = 0; switch (space.getSpace()) {
break; case Spacing::Single:
ls = 1;
break;
case Spacing::Onehalf:
ls = 2;
break;
case Spacing::Double:
ls = 3;
break;
case Spacing::Other:
ls = 4;
break;
default:
ls = 0;
break;
}
} }
linespacing->setCurrentIndex(ls); linespacing->setCurrentIndex(ls);
if (space.getSpace() == Spacing::Other) { if (space.getSpace() == Spacing::Other || pending_input) {
doubleToWidget(linespacingValue, space.getValue()); doubleToWidget(linespacingValue, space.getValue());
linespacingValue->setEnabled(true); linespacingValue->setEnabled(true);
} else { } else {