]> git.lyx.org Git - features.git/commitdiff
GuiDocument: re-introduce allowMathIndent()
authorUwe Stöhr <uwestoehr@lyx.org>
Thu, 20 Apr 2017 21:21:11 +0000 (23:21 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Thu, 20 Apr 2017 21:21:11 +0000 (23:21 +0200)
was accidentally reverted by [d86954eb/lyxgit]

src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiDocument.h

index 8469447f60ac502d062a160fdf772f3f667484ef..9d45890e9d119ff640f03db3eaef5e30e0475f25 100644 (file)
@@ -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);
index b33fca95f82ba511acc4334199108366960fc444..7527a59edc9cdf857c82ad856993ae2816e70c53 100644 (file)
@@ -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();