novelWriter 2.4.3__py3-none-any.whl → 2.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/METADATA +4 -5
  2. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/RECORD +122 -112
  3. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/WHEEL +1 -1
  4. novelwriter/__init__.py +33 -39
  5. novelwriter/assets/i18n/nw_de_DE.qm +0 -0
  6. novelwriter/assets/i18n/nw_en_US.qm +0 -0
  7. novelwriter/assets/i18n/nw_es_419.qm +0 -0
  8. novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
  9. novelwriter/assets/i18n/nw_it_IT.qm +0 -0
  10. novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
  11. novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
  12. novelwriter/assets/i18n/nw_nl_NL.qm +0 -0
  13. novelwriter/assets/i18n/nw_pl_PL.qm +0 -0
  14. novelwriter/assets/i18n/nw_pt_BR.qm +0 -0
  15. novelwriter/assets/i18n/nw_zh_CN.qm +0 -0
  16. novelwriter/assets/i18n/project_en_GB.json +1 -0
  17. novelwriter/assets/i18n/project_pl_PL.json +116 -0
  18. novelwriter/assets/i18n/project_pt_BR.json +74 -74
  19. novelwriter/assets/icons/typicons_dark/icons.conf +2 -0
  20. novelwriter/assets/icons/typicons_dark/nw_font.svg +4 -0
  21. novelwriter/assets/icons/typicons_dark/nw_quote.svg +4 -0
  22. novelwriter/assets/icons/typicons_light/icons.conf +2 -0
  23. novelwriter/assets/icons/typicons_light/nw_font.svg +4 -0
  24. novelwriter/assets/icons/typicons_light/nw_quote.svg +4 -0
  25. novelwriter/assets/manual.pdf +0 -0
  26. novelwriter/assets/sample.zip +0 -0
  27. novelwriter/assets/syntax/cyberpunk_night.conf +5 -3
  28. novelwriter/assets/syntax/default_dark.conf +32 -18
  29. novelwriter/assets/syntax/default_light.conf +24 -10
  30. novelwriter/assets/syntax/dracula.conf +44 -0
  31. novelwriter/assets/syntax/grey_dark.conf +5 -4
  32. novelwriter/assets/syntax/grey_light.conf +5 -4
  33. novelwriter/assets/syntax/light_owl.conf +7 -6
  34. novelwriter/assets/syntax/night_owl.conf +7 -6
  35. novelwriter/assets/syntax/snazzy.conf +42 -0
  36. novelwriter/assets/syntax/solarized_dark.conf +4 -3
  37. novelwriter/assets/syntax/solarized_light.conf +4 -3
  38. novelwriter/assets/syntax/tango.conf +27 -11
  39. novelwriter/assets/syntax/tomorrow.conf +6 -5
  40. novelwriter/assets/syntax/tomorrow_night.conf +7 -6
  41. novelwriter/assets/syntax/tomorrow_night_blue.conf +6 -5
  42. novelwriter/assets/syntax/tomorrow_night_bright.conf +6 -5
  43. novelwriter/assets/syntax/tomorrow_night_eighties.conf +6 -5
  44. novelwriter/assets/text/credits_en.htm +52 -41
  45. novelwriter/assets/themes/cyberpunk_night.conf +3 -0
  46. novelwriter/assets/themes/default_dark.conf +2 -0
  47. novelwriter/assets/themes/default_light.conf +2 -0
  48. novelwriter/assets/themes/dracula.conf +48 -0
  49. novelwriter/assets/themes/solarized_dark.conf +2 -0
  50. novelwriter/assets/themes/solarized_light.conf +2 -0
  51. novelwriter/common.py +33 -12
  52. novelwriter/config.py +184 -98
  53. novelwriter/constants.py +47 -35
  54. novelwriter/core/buildsettings.py +68 -69
  55. novelwriter/core/coretools.py +5 -23
  56. novelwriter/core/docbuild.py +52 -40
  57. novelwriter/core/document.py +3 -5
  58. novelwriter/core/index.py +115 -45
  59. novelwriter/core/item.py +8 -19
  60. novelwriter/core/options.py +2 -4
  61. novelwriter/core/project.py +37 -61
  62. novelwriter/core/projectdata.py +1 -3
  63. novelwriter/core/projectxml.py +12 -15
  64. novelwriter/core/sessions.py +3 -5
  65. novelwriter/core/spellcheck.py +4 -9
  66. novelwriter/core/status.py +211 -164
  67. novelwriter/core/storage.py +0 -8
  68. novelwriter/core/tohtml.py +139 -105
  69. novelwriter/core/tokenizer.py +278 -122
  70. novelwriter/core/{tomd.py → tomarkdown.py} +97 -78
  71. novelwriter/core/toodt.py +257 -166
  72. novelwriter/core/toqdoc.py +419 -0
  73. novelwriter/core/tree.py +5 -7
  74. novelwriter/dialogs/about.py +11 -18
  75. novelwriter/dialogs/docmerge.py +17 -19
  76. novelwriter/dialogs/docsplit.py +17 -19
  77. novelwriter/dialogs/editlabel.py +6 -10
  78. novelwriter/dialogs/preferences.py +200 -164
  79. novelwriter/dialogs/projectsettings.py +225 -189
  80. novelwriter/dialogs/quotes.py +12 -9
  81. novelwriter/dialogs/wordlist.py +9 -15
  82. novelwriter/enum.py +35 -30
  83. novelwriter/error.py +8 -15
  84. novelwriter/extensions/configlayout.py +55 -21
  85. novelwriter/extensions/eventfilters.py +1 -5
  86. novelwriter/extensions/modified.py +70 -14
  87. novelwriter/extensions/novelselector.py +1 -3
  88. novelwriter/extensions/pagedsidebar.py +9 -12
  89. novelwriter/extensions/{circularprogress.py → progressbars.py} +30 -8
  90. novelwriter/extensions/statusled.py +40 -26
  91. novelwriter/extensions/switch.py +4 -6
  92. novelwriter/extensions/switchbox.py +7 -6
  93. novelwriter/extensions/versioninfo.py +3 -9
  94. novelwriter/gui/doceditor.py +120 -139
  95. novelwriter/gui/dochighlight.py +231 -186
  96. novelwriter/gui/docviewer.py +69 -108
  97. novelwriter/gui/docviewerpanel.py +3 -10
  98. novelwriter/gui/editordocument.py +1 -3
  99. novelwriter/gui/itemdetails.py +7 -11
  100. novelwriter/gui/mainmenu.py +22 -18
  101. novelwriter/gui/noveltree.py +11 -24
  102. novelwriter/gui/outline.py +15 -26
  103. novelwriter/gui/projtree.py +39 -65
  104. novelwriter/gui/search.py +10 -3
  105. novelwriter/gui/sidebar.py +2 -6
  106. novelwriter/gui/statusbar.py +29 -37
  107. novelwriter/gui/theme.py +26 -48
  108. novelwriter/guimain.py +162 -160
  109. novelwriter/shared.py +36 -19
  110. novelwriter/text/patterns.py +113 -0
  111. novelwriter/tools/dictionaries.py +10 -20
  112. novelwriter/tools/lipsum.py +10 -16
  113. novelwriter/tools/manusbuild.py +9 -11
  114. novelwriter/tools/manuscript.py +75 -149
  115. novelwriter/tools/manussettings.py +74 -76
  116. novelwriter/tools/noveldetails.py +16 -21
  117. novelwriter/tools/welcome.py +21 -26
  118. novelwriter/tools/writingstats.py +9 -12
  119. novelwriter/types.py +49 -4
  120. novelwriter/extensions/simpleprogress.py +0 -55
  121. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/LICENSE.md +0 -0
  122. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/entry_points.txt +0 -0
  123. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/top_level.txt +0 -0
novelwriter/gui/theme.py CHANGED
@@ -46,12 +46,11 @@ STYLES_MIN_TOOLBUTTON = "minimalToolButton"
46
46
  STYLES_BIG_TOOLBUTTON = "bigToolButton"
47
47
 
48
48
 
49
- # =============================================================================================== #
50
- # Gui Theme Class
51
- # Handles the look and feel of novelWriter
52
- # =============================================================================================== #
53
-
54
49
  class GuiTheme:
50
+ """Gui Theme Class
51
+
52
+ Handles the look and feel of novelWriter.
53
+ """
55
54
 
56
55
  def __init__(self) -> None:
57
56
 
@@ -76,6 +75,8 @@ class GuiTheme:
76
75
  self.statUnsaved = QColor(0, 0, 0)
77
76
  self.statSaved = QColor(0, 0, 0)
78
77
  self.helpText = QColor(0, 0, 0)
78
+ self.fadedText = QColor(0, 0, 0)
79
+ self.errorText = QColor(255, 0, 0)
79
80
 
80
81
  # Loaded Syntax Settings
81
82
  # ======================
@@ -97,11 +98,12 @@ class GuiTheme:
97
98
  self.colHeadH = QColor(0, 0, 0)
98
99
  self.colEmph = QColor(0, 0, 0)
99
100
  self.colDialN = QColor(0, 0, 0)
100
- self.colDialD = QColor(0, 0, 0)
101
- self.colDialS = QColor(0, 0, 0)
101
+ self.colDialA = QColor(0, 0, 0)
102
102
  self.colHidden = QColor(0, 0, 0)
103
+ self.colNote = QColor(0, 0, 0)
103
104
  self.colCode = QColor(0, 0, 0)
104
105
  self.colKey = QColor(0, 0, 0)
106
+ self.colTag = QColor(0, 0, 0)
105
107
  self.colVal = QColor(0, 0, 0)
106
108
  self.colOpt = QColor(0, 0, 0)
107
109
  self.colSpell = QColor(0, 0, 0)
@@ -113,9 +115,6 @@ class GuiTheme:
113
115
  # Class Setup
114
116
  # ===========
115
117
 
116
- # Init GUI Font
117
- self._setGuiFont()
118
-
119
118
  # Load Themes
120
119
  self._guiPalette = QPalette()
121
120
  self._themeList: list[tuple[str, str]] = []
@@ -265,6 +264,8 @@ class GuiTheme:
265
264
  sec = "GUI"
266
265
  if parser.has_section(sec):
267
266
  self.helpText = self._parseColour(parser, sec, "helptext")
267
+ self.fadedText = self._parseColour(parser, sec, "fadedtext")
268
+ self.errorText = self._parseColour(parser, sec, "errortext")
268
269
  self.statNone = self._parseColour(parser, sec, "statusnone")
269
270
  self.statUnsaved = self._parseColour(parser, sec, "statusunsaved")
270
271
  self.statSaved = self._parseColour(parser, sec, "statussaved")
@@ -282,6 +283,10 @@ class GuiTheme:
282
283
  else:
283
284
  helpLCol = backLNess + 0.65*(textLNess - backLNess)
284
285
  self.helpText = QColor.fromHsl(0, 0, int(255*helpLCol))
286
+ logger.debug(
287
+ "Computed help text colour: rgb(%d, %d, %d)",
288
+ self.helpText.red(), self.helpText.green(), self.helpText.blue()
289
+ )
285
290
 
286
291
  # Icons
287
292
  defaultIcons = "typicons_light" if backLNess >= 0.5 else "typicons_dark"
@@ -339,12 +344,13 @@ class GuiTheme:
339
344
  self.colHead = self._parseColour(confParser, cnfSec, "headertext")
340
345
  self.colHeadH = self._parseColour(confParser, cnfSec, "headertag")
341
346
  self.colEmph = self._parseColour(confParser, cnfSec, "emphasis")
342
- self.colDialN = self._parseColour(confParser, cnfSec, "straightquotes")
343
- self.colDialD = self._parseColour(confParser, cnfSec, "doublequotes")
344
- self.colDialS = self._parseColour(confParser, cnfSec, "singlequotes")
347
+ self.colDialN = self._parseColour(confParser, cnfSec, "dialog")
348
+ self.colDialA = self._parseColour(confParser, cnfSec, "altdialog")
345
349
  self.colHidden = self._parseColour(confParser, cnfSec, "hidden")
350
+ self.colNote = self._parseColour(confParser, cnfSec, "note")
346
351
  self.colCode = self._parseColour(confParser, cnfSec, "shortcode")
347
352
  self.colKey = self._parseColour(confParser, cnfSec, "keyword")
353
+ self.colTag = self._parseColour(confParser, cnfSec, "tag")
348
354
  self.colVal = self._parseColour(confParser, cnfSec, "value")
349
355
  self.colOpt = self._parseColour(confParser, cnfSec, "optional")
350
356
  self.colSpell = self._parseColour(confParser, cnfSec, "spellcheckline")
@@ -401,27 +407,8 @@ class GuiTheme:
401
407
  self.statUnsaved = QColor(200, 15, 39)
402
408
  self.statSaved = QColor(2, 133, 37)
403
409
  self.helpText = QColor(0, 0, 0)
404
- return
405
-
406
- def _setGuiFont(self) -> None:
407
- """Update the GUI's font style from settings."""
408
- font = QFont()
409
- fontDB = QFontDatabase()
410
- if CONFIG.guiFont not in fontDB.families():
411
- if CONFIG.osWindows and "Arial" in fontDB.families():
412
- # On Windows we default to Arial if possible
413
- font.setFamily("Arial")
414
- font.setPointSize(10)
415
- else:
416
- font = fontDB.systemFont(QFontDatabase.SystemFont.GeneralFont)
417
- CONFIG.guiFont = font.family()
418
- CONFIG.guiFontSize = font.pointSize()
419
- else:
420
- font.setFamily(CONFIG.guiFont)
421
- font.setPointSize(CONFIG.guiFontSize)
422
-
423
- QApplication.setFont(font)
424
-
410
+ self.fadedText = QColor(128, 128, 128)
411
+ self.errorText = QColor(255, 0, 0)
425
412
  return
426
413
 
427
414
  def _listConf(self, targetDict: dict, checkDir: Path) -> bool:
@@ -480,12 +467,6 @@ class GuiTheme:
480
467
 
481
468
  return
482
469
 
483
- # End Class GuiTheme
484
-
485
-
486
- # =============================================================================================== #
487
- # Icons Class
488
- # =============================================================================================== #
489
470
 
490
471
  class GuiIcons:
491
472
  """The icon class manages the content of the assets/icons folder,
@@ -523,9 +504,9 @@ class GuiIcons:
523
504
 
524
505
  # General Button Icons
525
506
  "add", "add_document", "backward", "bookmark", "browse", "checked", "close", "cross",
526
- "document", "down", "edit", "export", "forward", "import", "list", "maximise", "menu",
527
- "minimise", "more", "noncheckable", "open", "panel", "refresh", "remove", "revert",
528
- "search_replace", "search", "settings", "star", "unchecked", "up", "view",
507
+ "document", "down", "edit", "export", "font", "forward", "import", "list", "maximise",
508
+ "menu", "minimise", "more", "noncheckable", "open", "panel", "quote", "refresh", "remove",
509
+ "revert", "search_replace", "search", "settings", "star", "unchecked", "up", "view",
529
510
 
530
511
  # Switches
531
512
  "sticky-on", "sticky-off",
@@ -793,12 +774,9 @@ class GuiIcons:
793
774
 
794
775
  return self._noIcon
795
776
 
796
- # END Class GuiIcons
797
-
798
777
 
799
- # =============================================================================================== #
800
- # Module Functions
801
- # =============================================================================================== #
778
+ # Module Functions
779
+ # ================
802
780
 
803
781
 
804
782
  def _sortTheme(data: tuple[str, str]) -> str: