Prevent permanent disabling of comboboxes in Vertical/Horizontal space dialogs

This commit is contained in:
Yuriy Skalko 2020-08-28 02:03:23 +03:00 committed by Juergen Spitzmueller
parent 1ef545a468
commit eb132b3b95
3 changed files with 21 additions and 13 deletions

View File

@ -305,13 +305,17 @@ docstring GuiHSpace::dialogToParams() const
bool GuiHSpace::checkWidgets(bool readonly) const
{
valueLE->setReadOnly(readonly);
spacingCO->setEnabled(!readonly);
spacingL->setEnabled(!readonly);
if (readonly) {
spacingCO->setEnabled(false);
unitCO->setEnabled(false);
fillPatternCO->setEnabled(false);
fillPatternL->setEnabled(false);
keepCB->setEnabled(false);
keepL->setEnabled(false);
valueLE->setEnabled(false);
valueL->setEnabled(false);
unitCO->setEnabled(false);
} else
enableWidgets();

View File

@ -152,18 +152,19 @@ void GuiVSpace::paramsToDialog(Inset const * inset)
bool GuiVSpace::checkWidgets(bool readonly) const
{
valueLE->setReadOnly(readonly);
keepCB->setEnabled(!readonly);
keepL->setEnabled(!readonly);
spacingCO->setEnabled(!readonly);
spacingL->setEnabled(!readonly);
if (readonly) {
spacingCO->setEnabled(false);
unitCO->setEnabled(false);
} else {
bool const enable = (spacingCO->currentIndex() == 5);
valueLE->setEnabled(enable);
valueL->setEnabled(enable);
unitCO->setEnabled(enable);
}
valueLE->setReadOnly(readonly);
bool const enable_custom =
!readonly && (spacingCO->currentIndex() == 5);
valueL->setEnabled(enable_custom);
valueLE->setEnabled(enable_custom);
unitCO->setEnabled(enable_custom);
return InsetParamsWidget::checkWidgets();
}

View File

@ -93,6 +93,9 @@ What's new
- Maintain standard layout for separating paragraphs when switching layouts (bug 11936).
- Prevent permanent disabling of widgets in Vertical/Horizontal Space dialogs
(bug 11952).
* INTERNALS