[LyX/master] Change the logic of the indentation setting.

Richard Kimberly Heck rikiheck at lyx.org
Fri Oct 30 17:09:24 UTC 2020


commit ca3077b40b38ebd2a18934b892c40c03250d778b
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Fri Oct 30 13:34:36 2020 -0400

    Change the logic of the indentation setting.
    
    The option here is to NOT indent the paragraph, so make that clear.
    As it was, we would set "Indent" to false in the case of paragraphs
    that do not permit indentation and then write that, uselessly, to the
    LyX file if we wrote any other option (and then keep writing it, even
    if other options were removed). Now, we will write it only if it's been
    explicitly set.
---
 src/frontends/qt/GuiParagraph.cpp  |   10 +++++-----
 src/frontends/qt/ui/ParagraphUi.ui |    8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/frontends/qt/GuiParagraph.cpp b/src/frontends/qt/GuiParagraph.cpp
index 0b54d7a..2b78fb4 100644
--- a/src/frontends/qt/GuiParagraph.cpp
+++ b/src/frontends/qt/GuiParagraph.cpp
@@ -61,7 +61,7 @@ GuiParagraph::GuiParagraph(GuiView & lv)
 	connect(linespacing, SIGNAL(activated(int)), this, SLOT(changed()));
 	connect(linespacingValue, SIGNAL(textChanged(QString)),
 		this, SLOT(changed()));
-	connect(indentCB, SIGNAL(clicked()), this, SLOT(changed()));
+	connect(noindentCB, SIGNAL(clicked()), this, SLOT(changed()));
 	connect(labelWidth, SIGNAL(textChanged(QString)),
 		this, SLOT(changed()));
 
@@ -237,7 +237,7 @@ void GuiParagraph::applyView()
 	// label width
 	params_.labelWidthString(qstring_to_ucs4(labelWidth->text()));
 	// indentation
-	params_.noindent(!indentCB->isChecked());
+	params_.noindent(noindentCB->isChecked());
 
 	dispatchParams();
 }
@@ -265,8 +265,8 @@ void GuiParagraph::updateView()
 
 	//indentation
 	bool const canindent = canIndent();
-	indentCB->setEnabled(canindent);
-	indentCB->setChecked(canindent && !pp.noindent());
+	noindentCB->setEnabled(canindent);
+	noindentCB->setChecked(canindent && pp.noindent());
 
 	// linespacing
 	int ls;
@@ -314,7 +314,7 @@ void GuiParagraph::updateView()
 
 void GuiParagraph::enableView(bool enable)
 {
-	indentCB->setEnabled(enable);
+	noindentCB->setEnabled(canIndent() && enable);
 	linespacing->setEnabled(enable);
 	labelWidth->setEnabled(enable);
 	synchronizedViewCB->setEnabled(enable);
diff --git a/src/frontends/qt/ui/ParagraphUi.ui b/src/frontends/qt/ui/ParagraphUi.ui
index 64d7139..255c1db 100644
--- a/src/frontends/qt/ui/ParagraphUi.ui
+++ b/src/frontends/qt/ui/ParagraphUi.ui
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>438</width>
+    <width>487</width>
     <height>303</height>
    </rect>
   </property>
@@ -196,9 +196,9 @@
     </widget>
    </item>
    <item row="2" column="0">
-    <widget class="QCheckBox" name="indentCB">
+    <widget class="QCheckBox" name="noindentCB">
      <property name="text">
-      <string>&Indent Paragraph</string>
+      <string>&Do Not Indent Paragraph</string>
      </property>
     </widget>
    </item>
@@ -251,7 +251,7 @@
   <tabstop>linespacing</tabstop>
   <tabstop>linespacingValue</tabstop>
   <tabstop>labelWidth</tabstop>
-  <tabstop>indentCB</tabstop>
+  <tabstop>noindentCB</tabstop>
   <tabstop>alignDefaultRB</tabstop>
   <tabstop>alignJustRB</tabstop>
   <tabstop>alignLeftRB</tabstop>


More information about the lyx-cvs mailing list