diff --git a/nw/assets/themes/syntax/default_light.conf b/nw/assets/themes/syntax/default_light.conf index 389ba6cb..908fd7cb 100644 --- a/nw/assets/themes/syntax/default_light.conf +++ b/nw/assets/themes/syntax/default_light.conf @@ -10,7 +10,7 @@ licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ background = 255, 255, 255 text = 0, 0, 0 link = 0, 0, 200 -headertext = 0, 100, 00 +headertext = 0, 100, 0 headertag = 50, 100, 50 emphasis = 150, 110, 30 straightquotes = 200, 0, 0 diff --git a/nw/assets/themes/syntax/grey_dark.conf b/nw/assets/themes/syntax/grey_dark.conf new file mode 100644 index 00000000..a6bc0420 --- /dev/null +++ b/nw/assets/themes/syntax/grey_dark.conf @@ -0,0 +1,25 @@ +[Main] +name = Grey Dark +author = Veronica Berglyd Olsen +credit = Veronica Berglyd Olsen +url = https://github.com/vkbo/novelWriter +license = CC BY-SA 4.0 +licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ + +[Syntax] +background = 54, 54, 54 +text = 200, 200, 200 +link = 200, 200, 200 +headertext = 225, 225, 225 +headertag = 225, 225, 225 +emphasis = 200, 200, 200 +straightquotes = 200, 200, 200 +doublequotes = 200, 200, 200 +singlequotes = 200, 200, 200 +hidden = 150, 150, 150 +keyword = 225, 225, 225 +value = 200, 200, 200 +spellcheckline = 200, 46, 0 +tagerror = 46, 200, 0 +replacetag = 225, 225, 225 +modifier = 225, 225, 225 diff --git a/nw/assets/themes/syntax/grey_light.conf b/nw/assets/themes/syntax/grey_light.conf new file mode 100644 index 00000000..a44593b4 --- /dev/null +++ b/nw/assets/themes/syntax/grey_light.conf @@ -0,0 +1,25 @@ +[Main] +name = Grey Light +author = Veronica Berglyd Olsen +credit = Veronica Berglyd Olsen +url = https://github.com/vkbo/novelWriter +license = CC BY-SA 4.0 +licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ + +[Syntax] +background = 255, 255, 255 +text = 20, 20, 20 +link = 20, 20, 20 +headertext = 0, 0, 0 +headertag = 0, 0, 0 +emphasis = 20, 20, 20 +straightquotes = 20, 20, 20 +doublequotes = 20, 20, 20 +singlequotes = 20, 20, 20 +hidden = 100, 100, 100 +keyword = 0, 0, 0 +value = 20, 20, 20 +spellcheckline = 200, 0, 0 +tagerror = 0, 150, 0 +replacetag = 0, 0, 0 +modifier = 0, 0, 0 diff --git a/nw/gui/about.py b/nw/gui/about.py index 99a4d296..c0c7885e 100644 --- a/nw/gui/about.py +++ b/nw/gui/about.py @@ -140,14 +140,14 @@ class GuiAbout(QDialog): "

novelWriter is a markdown-like text editor designed for " "organising and writing novels. It is written in Python 3 with a " "Qt5 GUI, using PyQt5.

" - "

novelWriter is free software: you can redistribute it and/or " + "

novelWriter is free software: you can redistribute it and " "modify it under the terms of the GNU General Public License as " "published by the Free Software Foundation, either version 3 of " "the License, or (at your option) any later version.

" "

novelWriter is distributed in the hope that it will be useful, " "but WITHOUT ANY WARRANTY; without even the implied warranty of " "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

" - "

See the License tab for the full text, or visit the GNU website " + "

See the License tab for the full license text, or visit the GNU website " "at GPL v3.0 " "for more details.

" "

Credits

" diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index d76623ce..48e44fbf 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -262,10 +262,10 @@ class GuiDocEditor(QTextEdit): # If we have a document open, we should reload it in case the # font changed, otherwise we just clear the editor entirely, # which makes it read only. - if self.theHandle is not None: - self.redrawText() - else: + if self.theHandle is None: self.clearEditor() + else: + self.redrawText() return True @@ -355,6 +355,7 @@ class GuiDocEditor(QTextEdit): """Redraw the text by marking the document content as "dirty". """ self.qDocument.markContentsDirty(0, self.qDocument.characterCount()) + self.updateDocMargins() return def replaceText(self, theText): diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index f3badad5..fab3b5ef 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -149,7 +149,7 @@ class GuiDocViewer(QTextBrowser): # If we have a document open, we should reload it in case the font changed if self.theHandle is not None: - self.redrawText() + self.reloadText() return True @@ -233,6 +233,7 @@ class GuiDocViewer(QTextBrowser): """Redraw the text by marking the document content as "dirty". """ self.qDocument.markContentsDirty(0, self.qDocument.characterCount()) + self.updateDocMargins() return def loadFromTag(self, theTag): diff --git a/nw/gui/preferences.py b/nw/gui/preferences.py index 2bb22bde..389c9f6f 100644 --- a/nw/gui/preferences.py +++ b/nw/gui/preferences.py @@ -227,7 +227,7 @@ class GuiConfigEditGeneralTab(QWidget): self.mainForm.addRow( "Show full path in document header", self.showFullPath, - "Shows the document title and parent folder names." + "Add the parent folder names to the header." ) self.hideVScroll = QSwitch() @@ -235,7 +235,7 @@ class GuiConfigEditGeneralTab(QWidget): self.mainForm.addRow( "Hide vertical scroll bars in main windows", self.hideVScroll, - "Scrolling with mouse wheel and keys only." + "Scrolling available with mouse wheel and keys only." ) self.hideHScroll = QSwitch() @@ -243,7 +243,7 @@ class GuiConfigEditGeneralTab(QWidget): self.mainForm.addRow( "Hide horizontal scroll bars in main windows", self.hideHScroll, - "Scrolling with mouse wheel and keys only." + "Scrolling available with mouse wheel and keys only." ) return @@ -325,8 +325,9 @@ class GuiConfigEditProjectsTab(QWidget): self.autoSaveDoc.setSingleStep(1) self.autoSaveDoc.setValue(self.mainConf.autoSaveDoc) self.backupPathRow = self.mainForm.addRow( - "Save interval for the currently open document", + "Save document interval", self.autoSaveDoc, + "How often the open document is automatically saved.", theUnit="seconds" ) @@ -337,8 +338,9 @@ class GuiConfigEditProjectsTab(QWidget): self.autoSaveProj.setSingleStep(1) self.autoSaveProj.setValue(self.mainConf.autoSaveProj) self.backupPathRow = self.mainForm.addRow( - "Save interval for the currently open project", + "Save project interval", self.autoSaveProj, + "How often the open project is automatically saved.", theUnit="seconds" ) @@ -361,9 +363,9 @@ class GuiConfigEditProjectsTab(QWidget): self.backupOnClose.setChecked(self.mainConf.backupOnClose) self.backupOnClose.toggled.connect(self._toggledBackupOnClose) self.mainForm.addRow( - "Run backup when closing project", + "Run backup when the project is closed", self.backupOnClose, - "This option can be overridden in project settings." + "Can be overridden for individual projects in project settings." ) ## Ask before backup @@ -373,7 +375,8 @@ class GuiConfigEditProjectsTab(QWidget): self.askBeforeBackup.setEnabled(self.mainConf.backupOnClose) self.mainForm.addRow( "Ask before running backup", - self.askBeforeBackup + self.askBeforeBackup, + "Disabling this will cause backups to run in the background." ) return @@ -426,7 +429,7 @@ class GuiConfigEditProjectsTab(QWidget): def _toggledBackupOnClose(self, theState): """Enable or disable switch that depends on the backup on close - switch, + switch. """ self.askBeforeBackup.setEnabled(theState) return @@ -449,7 +452,7 @@ class GuiConfigEditLayoutTab(QWidget): # Text Style # ========== - self.mainForm.addGroupLabel("Text Style") + self.mainForm.addGroupLabel("Document Text Style") ## Font Family self.textStyleFont = QLineEdit() @@ -475,12 +478,13 @@ class GuiConfigEditLayoutTab(QWidget): self.mainForm.addRow( "Font size", self.textStyleSize, + "Font size for the document editor and viewer.", theUnit = "pt" ) # Text Flow # ========= - self.mainForm.addGroupLabel("Text Flow") + self.mainForm.addGroupLabel("Document Text Flow") ## Max Text Width in Normal Mode self.textFlowMax = QSpinBox(self) @@ -491,6 +495,7 @@ class GuiConfigEditLayoutTab(QWidget): self.mainForm.addRow( "Maximum text width in \"Normal Mode\"", self.textFlowMax, + "Horizontal margins are scaled automatically.", theUnit="px" ) @@ -503,6 +508,7 @@ class GuiConfigEditLayoutTab(QWidget): self.mainForm.addRow( "Maximum text width in \"Focus Mode\"", self.focusDocWidth, + "Horizontal margins are scaled automatically.", theUnit="px" ) @@ -512,7 +518,7 @@ class GuiConfigEditLayoutTab(QWidget): self.mainForm.addRow( "Disable maximum text width in \"Normal Mode\"", self.textFlowFixed, - "If disabled, minimum text width is defined by the margin setting." + "If disabled, minimum text width is defined by the margin." ) ## Focus Mode Footer @@ -520,7 +526,8 @@ class GuiConfigEditLayoutTab(QWidget): self.hideFocusFooter.setChecked(self.mainConf.hideFocusFooter) self.mainForm.addRow( "Hide document footer in \"Focus Mode\"", - self.hideFocusFooter + self.hideFocusFooter, + "Hide the information bar at the bottom of the document." ) ## Justify Text @@ -528,7 +535,8 @@ class GuiConfigEditLayoutTab(QWidget): self.textJustify.setChecked(self.mainConf.textFixedW) self.mainForm.addRow( "Justify the text margins in editor and viewer", - self.textJustify + self.textJustify, + "Lay out text with straight edges in the editor and viewer." ) ## Document Margins @@ -538,9 +546,9 @@ class GuiConfigEditLayoutTab(QWidget): self.textMargin.setSingleStep(1) self.textMargin.setValue(self.mainConf.textMargin) self.mainForm.addRow( - "Document text margin", + "Text margin", self.textMargin, - "If max width is enabled, this is the minimum margin.", + "If maximum width is set, this becomes the minimum margin.", theUnit="px" ) @@ -551,8 +559,9 @@ class GuiConfigEditLayoutTab(QWidget): self.tabWidth.setSingleStep(1) self.tabWidth.setValue(self.mainConf.tabWidth) self.mainForm.addRow( - "Document tab width", + "Tab width", self.tabWidth, + "The width of a tab key press in the editor and viewer.", theUnit="px" ) @@ -566,7 +575,7 @@ class GuiConfigEditLayoutTab(QWidget): self.mainForm.addRow( "Scroll past end of the document", self.scrollPastEnd, - "Allows scrolling until last line is at the top." + "Allow scrolling until the last line is centred in the editor." ) ## Typewriter Scrolling @@ -575,7 +584,7 @@ class GuiConfigEditLayoutTab(QWidget): self.mainForm.addRow( "Typewriter style scrolling when you type", self.autoScroll, - "Tries to keep the cursor at a fixed vertical position." + "Try to keep the cursor at a fixed vertical position." ) ## Font Size @@ -678,7 +687,7 @@ class GuiConfigEditEditingTab(QWidget): self.mainForm.addRow( "Highlight theme", self.selectSyntax, - "" + "Colour theme to apply to the editor and viewer." ) self.highlightQuotes = QSwitch() @@ -686,7 +695,7 @@ class GuiConfigEditEditingTab(QWidget): self.mainForm.addRow( "Highlight text wrapped in quotes", self.highlightQuotes, - helpText="Applies to single, double and straight quotes." + "Applies to single, double and straight quotes." ) self.highlightEmph = QSwitch() @@ -694,7 +703,7 @@ class GuiConfigEditEditingTab(QWidget): self.mainForm.addRow( "Add highlight colour to emphasised text", self.highlightEmph, - helpText="Applies to emphasis, strong and strikethrough." + "Applies to emphasis, strong and strikethrough." ) # Spell Checking @@ -724,7 +733,8 @@ class GuiConfigEditEditingTab(QWidget): ) self.mainForm.addRow( "Spell check language", - self.spellLangList + self.spellLangList, + "Available languages are determined by your system." ) ## Big Document Size Limit @@ -736,7 +746,7 @@ class GuiConfigEditEditingTab(QWidget): self.mainForm.addRow( "Big document limit", self.bigDocLimit, - "Disables full spell checking over the size limit.", + "Full spell checking is disabled above this limit.", theUnit="kB" ) @@ -749,7 +759,8 @@ class GuiConfigEditEditingTab(QWidget): self.showTabsNSpaces.setChecked(self.mainConf.showTabsNSpaces) self.mainForm.addRow( "Show tabs and spaces", - self.showTabsNSpaces + self.showTabsNSpaces, + "Add symbols to indicate tabs and spaces in the editor." ) ## Show Line Endings @@ -757,7 +768,8 @@ class GuiConfigEditEditingTab(QWidget): self.showLineEndings.setChecked(self.mainConf.showLineEndings) self.mainForm.addRow( "Show line endings", - self.showLineEndings + self.showLineEndings, + "Add a symbol to indicate line endings in the editor." ) return @@ -866,7 +878,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Auto-replace text as you type", self.autoReplaceMain, - "Apply formatting to word under cursor if no selection is made." + "Allow the editor to replace symbols as you type." ) # Auto-Replace @@ -880,7 +892,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Auto-replace single quotes", self.autoReplaceSQ, - "The feature will try to guess opening or closing single quote." + "Try to guess which is an opening or a closing single quote." ) ## Auto-Replace Double Quotes @@ -890,7 +902,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Auto-replace double quotes", self.autoReplaceDQ, - "The feature will try to guess opening or closing quote quote." + "Try to guess which is an opening or a closing double quote." ) ## Auto-Replace Hyphens @@ -900,7 +912,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Auto-replace dashes", self.autoReplaceDash, - "Auto-replace double and triple hyphens with short and long dash." + "Double and triple hyphens become short and long dashes." ) ## Auto-Replace Dots @@ -910,7 +922,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Auto-replace dots", self.autoReplaceDots, - "Auto-replace three dots with ellipsis." + "Three consecutive dots becomes ellipsis." ) # Quotation Style @@ -934,7 +946,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Single quote open style", self.quoteSym["SO"], - "Auto-replaces apostrophe before words.", + "The symbol to use for a leading single quote.", theButton=self.btnSingleStyleO ) @@ -950,7 +962,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Single quote close style", self.quoteSym["SC"], - "Auto-replaces apostrophe after words.", + "The symbol to use for a trailing single quote.", theButton=self.btnSingleStyleC ) @@ -967,7 +979,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Double quote open style", self.quoteSym["DO"], - "Auto-replaces straight quotes before words.", + "The symbol to use for a leading double quote.", theButton=self.btnDoubleStyleO ) @@ -983,7 +995,7 @@ class GuiConfigEditAutoReplaceTab(QWidget): self.mainForm.addRow( "Double quote close style", self.quoteSym["DC"], - "Auto-replaces straight quotes after words.", + "The symbol to use for a trailing double quote.", theButton=self.btnDoubleStyleC ) diff --git a/nw/gui/theme.py b/nw/gui/theme.py index 2b5f31f5..c2b4b9fd 100644 --- a/nw/gui/theme.py +++ b/nw/gui/theme.py @@ -281,11 +281,11 @@ class GuiTheme: cnfSec = "Main" if confParser.has_section(cnfSec): self.themeName = self._parseLine(confParser, cnfSec, "name", "") - self.themeDescription = self._parseLine(confParser, cnfSec, "description", "") - self.themeAuthor = self._parseLine(confParser, cnfSec, "author", "") - self.themeCredit = self._parseLine(confParser, cnfSec, "credit", "") + self.themeDescription = self._parseLine(confParser, cnfSec, "description", "N/A") + self.themeAuthor = self._parseLine(confParser, cnfSec, "author", "N/A") + self.themeCredit = self._parseLine(confParser, cnfSec, "credit", "N/A") self.themeUrl = self._parseLine(confParser, cnfSec, "url", "") - self.themeLicense = self._parseLine(confParser, cnfSec, "license", "") + self.themeLicense = self._parseLine(confParser, cnfSec, "license", "N/A") self.themeLicenseUrl = self._parseLine(confParser, cnfSec, "licenseurl", "") ## Palette @@ -638,10 +638,10 @@ class GuiIcons: if confParser.has_section(cnfSec): self.themeName = self._parseLine(confParser, cnfSec, "name", "") self.themeDescription = self._parseLine(confParser, cnfSec, "description", "") - self.themeAuthor = self._parseLine(confParser, cnfSec, "author", "") - self.themeCredit = self._parseLine(confParser, cnfSec, "credit", "") + self.themeAuthor = self._parseLine(confParser, cnfSec, "author", "N/A") + self.themeCredit = self._parseLine(confParser, cnfSec, "credit", "N/A") self.themeUrl = self._parseLine(confParser, cnfSec, "url", "") - self.themeLicense = self._parseLine(confParser, cnfSec, "license", "") + self.themeLicense = self._parseLine(confParser, cnfSec, "license", "N/A") self.themeLicenseUrl = self._parseLine(confParser, cnfSec, "licenseurl", "") ## Palette