[LyX/2.3.x] Prevent permanent disabling of comboboxes in Vertical/Horizontal space dialogs

Juergen Spitzmueller spitz at lyx.org
Sat Aug 29 08:59:13 UTC 2020


commit eb132b3b95f68ec762567080b586d4a4725fc4da
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Fri Aug 28 02:03:23 2020 +0300

    Prevent permanent disabling of comboboxes in Vertical/Horizontal space dialogs
---
 src/frontends/qt4/GuiHSpace.cpp |   10 +++++++---
 src/frontends/qt4/GuiVSpace.cpp |   21 +++++++++++----------
 status.23x                      |    3 +++
 3 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/frontends/qt4/GuiHSpace.cpp b/src/frontends/qt4/GuiHSpace.cpp
index 4307ae0..da28890 100644
--- a/src/frontends/qt4/GuiHSpace.cpp
+++ b/src/frontends/qt4/GuiHSpace.cpp
@@ -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();
 
diff --git a/src/frontends/qt4/GuiVSpace.cpp b/src/frontends/qt4/GuiVSpace.cpp
index 6eec958..5f12b56 100644
--- a/src/frontends/qt4/GuiVSpace.cpp
+++ b/src/frontends/qt4/GuiVSpace.cpp
@@ -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();
 }
diff --git a/status.23x b/status.23x
index 23f5d67..aef6ca6 100644
--- a/status.23x
+++ b/status.23x
@@ -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
 


More information about the lyx-cvs mailing list