From df4ea641c202b4a25b0758c2e15615e29bc92eb5 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 2 Nov 2019 21:16:24 +0100 Subject: [PATCH] The fixed width setting should really be maximum width. The text margins should be minimum margins. --- nw/config.py | 2 +- nw/gui/dialogs/configeditor.py | 4 ++-- nw/gui/elements/doceditor.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nw/config.py b/nw/config.py index 42d584e8..2e0baacb 100644 --- a/nw/config.py +++ b/nw/config.py @@ -76,7 +76,7 @@ class Config: ## Text Editor self.textFont = None self.textSize = 12 - self.textFixedW = False + self.textFixedW = True self.textWidth = 600 self.textMargin = 40 self.tabWidth = 40 diff --git a/nw/gui/dialogs/configeditor.py b/nw/gui/dialogs/configeditor.py index 2f13ef89..031af758 100644 --- a/nw/gui/dialogs/configeditor.py +++ b/nw/gui/dialogs/configeditor.py @@ -322,8 +322,8 @@ class GuiConfigEditEditor(QWidget): self.textFlowForm = QGridLayout(self) self.textFlow.setLayout(self.textFlowForm) - self.textFlowFixed = QCheckBox("Fixed width",self) - self.textFlowFixed.setToolTip("Make text in editor fixed width and scale margins instead.") + self.textFlowFixed = QCheckBox("Max text width",self) + self.textFlowFixed.setToolTip("Maximum width of the text.") if self.mainConf.textFixedW: self.textFlowFixed.setCheckState(Qt.Checked) else: diff --git a/nw/gui/elements/doceditor.py b/nw/gui/elements/doceditor.py index 6b78eee6..e8bc23b7 100644 --- a/nw/gui/elements/doceditor.py +++ b/nw/gui/elements/doceditor.py @@ -293,8 +293,8 @@ class GuiDocEditor(QTextEdit): tW = self.mainConf.textWidth wW = self.width() tM = int((wW - sW - tW)/2) - if tM < 0: - tM = 0 + if tM < self.mainConf.textMargin: + tM = self.mainConf.textMargin docFormat = self.qDocument.rootFrame().frameFormat() docFormat.setLeftMargin(tM) docFormat.setRightMargin(tM)