From 3d682e154e8240c0358b1b65120a8e751d73c0af Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 27 Jun 2020 21:17:41 +0200 Subject: [PATCH 1/3] Added the hideZenFooter config option --- nw/config.py | 5 +++++ nw/gui/preferences.py | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/nw/config.py b/nw/config.py index 09b3d3634..8e7b6a615 100644 --- a/nw/config.py +++ b/nw/config.py @@ -112,6 +112,7 @@ def __init__(self): self.textMargin = 40 self.tabWidth = 40 self.zenWidth = 800 + self.hideZenFooter = False self.doJustify = False self.autoSelect = True self.doReplace = True @@ -417,6 +418,9 @@ def loadConfig(self): self.zenWidth = self._parseLine( cnfParse, cnfSec, "zenwidth", self.CNF_INT, self.zenWidth ) + self.hideZenFooter = self._parseLine( + cnfParse, cnfSec, "hidezenfooter", self.CNF_BOOL, self.hideZenFooter + ) self.doJustify = self._parseLine( cnfParse, cnfSec, "justify", self.CNF_BOOL, self.doJustify ) @@ -569,6 +573,7 @@ def saveConfig(self): cnfParse.set(cnfSec,"margin", str(self.textMargin)) cnfParse.set(cnfSec,"tabwidth", str(self.tabWidth)) cnfParse.set(cnfSec,"zenwidth", str(self.zenWidth)) + cnfParse.set(cnfSec,"hidezenfooter", str(self.hideZenFooter)) cnfParse.set(cnfSec,"justify", str(self.doJustify)) cnfParse.set(cnfSec,"autoselect", str(self.autoSelect)) cnfParse.set(cnfSec,"autoreplace", str(self.doReplace)) diff --git a/nw/gui/preferences.py b/nw/gui/preferences.py index 569053074..3abedfc26 100644 --- a/nw/gui/preferences.py +++ b/nw/gui/preferences.py @@ -452,6 +452,14 @@ def __init__(self, theParent): "If disabled, minimum text width is defined by the margin setting." ) + ## Zen Mode Footer + self.hideZenFooter = QSwitch() + self.hideZenFooter.setChecked(self.mainConf.hideZenFooter) + self.mainForm.addRow( + "Hide document footer in \"Zen Mode\"", + self.hideZenFooter + ) + ## Justify Text self.textJustify = QSwitch() self.textJustify.setChecked(self.mainConf.textFixedW) @@ -538,6 +546,7 @@ def saveValues(self): textWidth = self.textFlowMax.value() zenWidth = self.zenDocWidth.value() textFixedW = not self.textFlowFixed.isChecked() + hideZenFooter = self.hideZenFooter.isChecked() doJustify = self.textJustify.isChecked() textMargin = self.textMargin.value() tabWidth = self.tabWidth.value() @@ -551,6 +560,7 @@ def saveValues(self): self.mainConf.textWidth = textWidth self.mainConf.zenWidth = zenWidth self.mainConf.textFixedW = textFixedW + self.mainConf.hideZenFooter = hideZenFooter self.mainConf.doJustify = doJustify self.mainConf.textMargin = textMargin self.mainConf.tabWidth = tabWidth From c67e5f444a923681c2c6639111e0232e7dc15d13 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 27 Jun 2020 21:21:13 +0200 Subject: [PATCH 2/3] Added the code to hide document footer --- nw/guimain.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nw/guimain.py b/nw/guimain.py index 1777cf1c4..8a115f0db 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -942,6 +942,9 @@ def toggleZenMode(self): self.mainMenu.setVisible(isVisible) self.tabWidget.tabBar().setVisible(isVisible) + hideDocFooter = self.isZenMode and self.mainConf.hideZenFooter + self.docEditor.docFooter.setVisible(not hideDocFooter) + if self.splitView.isVisible(): self.splitView.setVisible(False) elif self.docViewer.theHandle is not None: From 6b70d9677d5fa884393187c87e8c7dbaa30a9fc7 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 27 Jun 2020 21:21:49 +0200 Subject: [PATCH 3/3] Fixed tests --- tests/reference/novelwriter.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/reference/novelwriter.conf b/tests/reference/novelwriter.conf index 12e6ec110..a52a91dfc 100644 --- a/tests/reference/novelwriter.conf +++ b/tests/reference/novelwriter.conf @@ -1,5 +1,5 @@ [Main] -timestamp = 2020-06-17 19:45:53 +timestamp = 2020-06-27 21:21:19 theme = default syntax = default_light icons = typicons_colour_light @@ -29,6 +29,7 @@ width = 600 margin = 40 tabwidth = 40 zenwidth = 800 +hidezenfooter = False justify = False autoselect = True autoreplace = True