mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Fix bug 8880: do not try to validate custom value if it is disabled
This commit is contained in:
parent
6f488a9ef2
commit
7e22abec5d
@ -104,12 +104,16 @@ void GuiHSpace::enableWidgets()
|
||||
QString const selection = spacingCO->itemData(spacingCO->currentIndex()).toString();
|
||||
bool const custom = selection == "custom";
|
||||
valueLE->setEnabled(custom);
|
||||
valueL->setEnabled(custom);
|
||||
unitCO->setEnabled(custom);
|
||||
fillPatternCO->setEnabled(!math_mode_ && selection == "hfill");
|
||||
fillPatternL->setEnabled(!math_mode_ && selection == "hfill");
|
||||
bool const no_pattern = fillPatternCO->currentIndex() == 0 || math_mode_;
|
||||
bool const enable_keep =
|
||||
selection == "normal" || selection == "halfquad" || (selection == "hfill" && no_pattern) || custom;
|
||||
selection == "normal" || selection == "halfquad"
|
||||
|| (selection == "hfill" && no_pattern) || custom;
|
||||
keepCB->setEnabled(enable_keep);
|
||||
keepL->setEnabled(enable_keep);
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,6 +29,10 @@ CheckedWidget::CheckedWidget(QLineEdit * input, QWidget * label)
|
||||
|
||||
bool CheckedWidget::check() const
|
||||
{
|
||||
// Ignore if widget is disabled.
|
||||
if (!input_->isEnabled())
|
||||
return true;
|
||||
|
||||
bool const valid = input_->hasAcceptableInput();
|
||||
// Visual feedback.
|
||||
setValid(input_, valid);
|
||||
|
Loading…
Reference in New Issue
Block a user