From 2cdd444e29117a886090929f30f297f8ae647c03 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:48:47 +0100 Subject: [PATCH 1/2] Fix issue #623 --- nw/gui/preferences.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nw/gui/preferences.py b/nw/gui/preferences.py index 90b86a88..8b4398c4 100644 --- a/nw/gui/preferences.py +++ b/nw/gui/preferences.py @@ -532,7 +532,7 @@ class GuiConfigEditLayoutTab(QWidget): ## Justify Text self.textJustify = QSwitch() - self.textJustify.setChecked(self.mainConf.textFixedW) + self.textJustify.setChecked(self.mainConf.doJustify) self.mainForm.addRow( "Justify the text margins in editor and viewer", self.textJustify, From 82d9165d924d65c851f456f00660c2525ce3ef11 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 30 Jan 2021 15:00:51 +0100 Subject: [PATCH 2/2] Fix test --- tests/reference/guiPreferences_novelwriter.conf | 2 +- tests/test_gui_preferences.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/reference/guiPreferences_novelwriter.conf b/tests/reference/guiPreferences_novelwriter.conf index cdbc5337..6ae4c6aa 100644 --- a/tests/reference/guiPreferences_novelwriter.conf +++ b/tests/reference/guiPreferences_novelwriter.conf @@ -33,7 +33,7 @@ margin = 45 tabwidth = 45 focuswidth = 900 hidefocusfooter = True -justify = False +justify = True autoselect = False autoreplace = False repsquotes = True diff --git a/tests/test_gui_preferences.py b/tests/test_gui_preferences.py index 4c8b17ea..ac1f59f5 100644 --- a/tests/test_gui_preferences.py +++ b/tests/test_gui_preferences.py @@ -140,9 +140,9 @@ def testGuiPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir): assert tabLayout.hideFocusFooter.isChecked() qtbot.wait(keyDelay) - assert tabLayout.textJustify.isChecked() - qtbot.mouseClick(tabLayout.textJustify, Qt.LeftButton) assert not tabLayout.textJustify.isChecked() + qtbot.mouseClick(tabLayout.textJustify, Qt.LeftButton) + assert tabLayout.textJustify.isChecked() qtbot.wait(keyDelay) assert tabLayout.scrollPastEnd.isChecked()