commit 6cabf4948fe08f6567519e7997750083d1af3339
Author: Uwe Stöhr <[email protected]>
Date: Thu Apr 20 23:21:11 2017 +0200
GuiDocument: re-introduce allowMathIndent()
was accidentally reverted by [d86954eb/lyxgit]
---
src/frontends/qt4/GuiDocument.cpp | 16 ++++++++++++++++
src/frontends/qt4/GuiDocument.h | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/frontends/qt4/GuiDocument.cpp
b/src/frontends/qt4/GuiDocument.cpp
index 8469447..9d45890 100644
--- a/src/frontends/qt4/GuiDocument.cpp
+++ b/src/frontends/qt4/GuiDocument.cpp
@@ -726,6 +726,8 @@ GuiDocument::GuiDocument(GuiView & lv)
connect(textLayoutModule->MathIndentCB, SIGNAL(toggled(bool)),
this, SLOT(change_adaptor()));
+ connect(textLayoutModule->MathIndentCB, SIGNAL(toggled(bool)),
+ this, SLOT(allowMathIndent()));
connect(textLayoutModule->MathIndentCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(textLayoutModule->MathIndentCO, SIGNAL(activated(int)),
@@ -1609,6 +1611,20 @@ void GuiDocument::enableSkip(bool skip)
setSkip(textLayoutModule->skipCO->currentIndex());
}
+void GuiDocument::allowMathIndent() {
+ // only disable when not checked, checked does not always allow enabling
+ if (!textLayoutModule->MathIndentCB->isChecked()) {
+ textLayoutModule->MathIndentLE->setEnabled(false);
+ textLayoutModule->MathIndentLengthCO->setEnabled(false);
+ }
+ if (textLayoutModule->MathIndentCB->isChecked()
+ && textLayoutModule->MathIndentCO->currentIndex() == 1) {
+ textLayoutModule->MathIndentLE->setEnabled(true);
+ textLayoutModule->MathIndentLengthCO->setEnabled(true);
+ }
+ isValid();
+}
+
void GuiDocument::setMathIndent(int item)
{
bool const enable = (item == 1);
diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h
index b33fca9..7527a59 100644
--- a/src/frontends/qt4/GuiDocument.h
+++ b/src/frontends/qt4/GuiDocument.h
@@ -109,6 +109,7 @@ private Q_SLOTS:
void enableIndent(bool);
void setSkip(int);
void enableSkip(bool);
+ void allowMathIndent();
void setMathIndent(int);
void browseLayout();
void browseMaster();