novelWriter 2.4.4__py3-none-any.whl → 2.5rc1__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 (110) hide show
  1. {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/METADATA +4 -5
  2. {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/RECORD +109 -101
  3. {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/WHEEL +1 -1
  4. novelwriter/__init__.py +33 -39
  5. novelwriter/assets/i18n/project_en_GB.json +1 -0
  6. novelwriter/assets/icons/typicons_dark/icons.conf +2 -0
  7. novelwriter/assets/icons/typicons_dark/nw_font.svg +4 -0
  8. novelwriter/assets/icons/typicons_dark/nw_quote.svg +4 -0
  9. novelwriter/assets/icons/typicons_light/icons.conf +2 -0
  10. novelwriter/assets/icons/typicons_light/nw_font.svg +4 -0
  11. novelwriter/assets/icons/typicons_light/nw_quote.svg +4 -0
  12. novelwriter/assets/manual.pdf +0 -0
  13. novelwriter/assets/sample.zip +0 -0
  14. novelwriter/assets/syntax/cyberpunk_night.conf +5 -3
  15. novelwriter/assets/syntax/default_dark.conf +32 -18
  16. novelwriter/assets/syntax/default_light.conf +24 -10
  17. novelwriter/assets/syntax/dracula.conf +44 -0
  18. novelwriter/assets/syntax/grey_dark.conf +5 -4
  19. novelwriter/assets/syntax/grey_light.conf +5 -4
  20. novelwriter/assets/syntax/light_owl.conf +7 -6
  21. novelwriter/assets/syntax/night_owl.conf +7 -6
  22. novelwriter/assets/syntax/snazzy.conf +42 -0
  23. novelwriter/assets/syntax/solarized_dark.conf +4 -3
  24. novelwriter/assets/syntax/solarized_light.conf +4 -3
  25. novelwriter/assets/syntax/tango.conf +27 -11
  26. novelwriter/assets/syntax/tomorrow.conf +6 -5
  27. novelwriter/assets/syntax/tomorrow_night.conf +7 -6
  28. novelwriter/assets/syntax/tomorrow_night_blue.conf +6 -5
  29. novelwriter/assets/syntax/tomorrow_night_bright.conf +6 -5
  30. novelwriter/assets/syntax/tomorrow_night_eighties.conf +6 -5
  31. novelwriter/assets/text/credits_en.htm +4 -1
  32. novelwriter/assets/themes/cyberpunk_night.conf +3 -0
  33. novelwriter/assets/themes/default_dark.conf +2 -0
  34. novelwriter/assets/themes/default_light.conf +2 -0
  35. novelwriter/assets/themes/dracula.conf +48 -0
  36. novelwriter/assets/themes/solarized_dark.conf +2 -0
  37. novelwriter/assets/themes/solarized_light.conf +2 -0
  38. novelwriter/common.py +33 -12
  39. novelwriter/config.py +184 -98
  40. novelwriter/constants.py +47 -35
  41. novelwriter/core/buildsettings.py +68 -69
  42. novelwriter/core/coretools.py +5 -23
  43. novelwriter/core/docbuild.py +52 -40
  44. novelwriter/core/document.py +3 -5
  45. novelwriter/core/index.py +115 -45
  46. novelwriter/core/item.py +8 -19
  47. novelwriter/core/options.py +2 -4
  48. novelwriter/core/project.py +23 -57
  49. novelwriter/core/projectdata.py +1 -3
  50. novelwriter/core/projectxml.py +12 -15
  51. novelwriter/core/sessions.py +3 -5
  52. novelwriter/core/spellcheck.py +4 -9
  53. novelwriter/core/status.py +211 -164
  54. novelwriter/core/storage.py +0 -8
  55. novelwriter/core/tohtml.py +139 -105
  56. novelwriter/core/tokenizer.py +278 -122
  57. novelwriter/core/{tomd.py → tomarkdown.py} +97 -78
  58. novelwriter/core/toodt.py +257 -166
  59. novelwriter/core/toqdoc.py +419 -0
  60. novelwriter/core/tree.py +5 -7
  61. novelwriter/dialogs/about.py +11 -18
  62. novelwriter/dialogs/docmerge.py +17 -19
  63. novelwriter/dialogs/docsplit.py +17 -19
  64. novelwriter/dialogs/editlabel.py +6 -10
  65. novelwriter/dialogs/preferences.py +193 -144
  66. novelwriter/dialogs/projectsettings.py +225 -189
  67. novelwriter/dialogs/quotes.py +12 -9
  68. novelwriter/dialogs/wordlist.py +9 -15
  69. novelwriter/enum.py +35 -30
  70. novelwriter/error.py +8 -15
  71. novelwriter/extensions/configlayout.py +40 -21
  72. novelwriter/extensions/eventfilters.py +1 -5
  73. novelwriter/extensions/modified.py +58 -14
  74. novelwriter/extensions/novelselector.py +1 -3
  75. novelwriter/extensions/pagedsidebar.py +9 -12
  76. novelwriter/extensions/{circularprogress.py → progressbars.py} +30 -8
  77. novelwriter/extensions/statusled.py +29 -25
  78. novelwriter/extensions/switch.py +4 -6
  79. novelwriter/extensions/switchbox.py +7 -6
  80. novelwriter/extensions/versioninfo.py +3 -9
  81. novelwriter/gui/doceditor.py +118 -137
  82. novelwriter/gui/dochighlight.py +231 -186
  83. novelwriter/gui/docviewer.py +66 -107
  84. novelwriter/gui/docviewerpanel.py +3 -10
  85. novelwriter/gui/editordocument.py +1 -3
  86. novelwriter/gui/itemdetails.py +7 -11
  87. novelwriter/gui/mainmenu.py +22 -18
  88. novelwriter/gui/noveltree.py +11 -24
  89. novelwriter/gui/outline.py +14 -26
  90. novelwriter/gui/projtree.py +35 -60
  91. novelwriter/gui/search.py +10 -3
  92. novelwriter/gui/sidebar.py +2 -6
  93. novelwriter/gui/statusbar.py +29 -37
  94. novelwriter/gui/theme.py +26 -48
  95. novelwriter/guimain.py +134 -148
  96. novelwriter/shared.py +36 -32
  97. novelwriter/text/patterns.py +113 -0
  98. novelwriter/tools/dictionaries.py +10 -20
  99. novelwriter/tools/lipsum.py +10 -16
  100. novelwriter/tools/manusbuild.py +9 -11
  101. novelwriter/tools/manuscript.py +71 -145
  102. novelwriter/tools/manussettings.py +71 -75
  103. novelwriter/tools/noveldetails.py +16 -21
  104. novelwriter/tools/welcome.py +12 -26
  105. novelwriter/tools/writingstats.py +9 -12
  106. novelwriter/types.py +49 -4
  107. novelwriter/extensions/simpleprogress.py +0 -55
  108. {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/LICENSE.md +0 -0
  109. {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/entry_points.txt +0 -0
  110. {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/top_level.txt +0 -0
novelwriter/types.py CHANGED
@@ -23,9 +23,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
23
23
  """
24
24
  from __future__ import annotations
25
25
 
26
- from PyQt5.QtCore import Qt
27
- from PyQt5.QtGui import QColor, QPainter, QTextCursor
28
- from PyQt5.QtWidgets import QDialogButtonBox, QStyle
26
+ from PyQt5.QtCore import QRegularExpression, Qt
27
+ from PyQt5.QtGui import QColor, QFont, QPainter, QTextCharFormat, QTextCursor, QTextFormat
28
+ from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QSizePolicy, QStyle
29
29
 
30
30
  # Qt Alignment Flags
31
31
 
@@ -44,9 +44,19 @@ QtAlignRightMiddle = Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignVCenter
44
44
  QtAlignRightTop = Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignTop
45
45
  QtAlignTop = Qt.AlignmentFlag.AlignTop
46
46
 
47
+ QtVAlignNormal = QTextCharFormat.VerticalAlignment.AlignNormal
48
+ QtVAlignSub = QTextCharFormat.VerticalAlignment.AlignSubScript
49
+ QtVAlignSuper = QTextCharFormat.VerticalAlignment.AlignSuperScript
50
+
51
+ # Qt Page Break
52
+
53
+ QtPageBreakBefore = QTextFormat.PageBreakFlag.PageBreak_AlwaysBefore
54
+ QtPageBreakAfter = QTextFormat.PageBreakFlag.PageBreak_AlwaysAfter
55
+
47
56
  # Qt Painter Types
48
57
 
49
58
  QtTransparent = QColor(0, 0, 0, 0)
59
+ QtBlack = QColor(0, 0, 0)
50
60
  QtNoBrush = Qt.BrushStyle.NoBrush
51
61
  QtNoPen = Qt.PenStyle.NoPen
52
62
  QtRoundCap = Qt.PenCapStyle.RoundCap
@@ -63,13 +73,16 @@ QtUserRole = Qt.ItemDataRole.UserRole
63
73
  # Keyboard and Mouse Buttons
64
74
 
65
75
  QtModCtrl = Qt.KeyboardModifier.ControlModifier
66
- QtModeNone = Qt.KeyboardModifier.NoModifier
76
+ QtModNone = Qt.KeyboardModifier.NoModifier
67
77
  QtModShift = Qt.KeyboardModifier.ShiftModifier
68
78
  QtMouseLeft = Qt.MouseButton.LeftButton
69
79
  QtMouseMiddle = Qt.MouseButton.MiddleButton
70
80
 
71
81
  # Dialog Button Box Types
72
82
 
83
+ QtAccepted = QDialog.DialogCode.Accepted
84
+ QtRejected = QDialog.DialogCode.Rejected
85
+
73
86
  QtDialogApply = QDialogButtonBox.StandardButton.Apply
74
87
  QtDialogCancel = QDialogButtonBox.StandardButton.Cancel
75
88
  QtDialogClose = QDialogButtonBox.StandardButton.Close
@@ -88,3 +101,35 @@ QtKeepAnchor = QTextCursor.MoveMode.KeepAnchor
88
101
  QtMoveAnchor = QTextCursor.MoveMode.MoveAnchor
89
102
  QtMoveLeft = QTextCursor.MoveOperation.Left
90
103
  QtMoveRight = QTextCursor.MoveOperation.Right
104
+
105
+ # Size Policy
106
+
107
+ QtSizeExpanding = QSizePolicy.Policy.Expanding
108
+ QtSizeFixed = QSizePolicy.Policy.Fixed
109
+ QtSizeIgnored = QSizePolicy.Policy.Ignored
110
+ QtSizeMinimum = QSizePolicy.Policy.Minimum
111
+ QtSizeMinimumExpanding = QSizePolicy.Policy.MinimumExpanding
112
+
113
+ # Other
114
+
115
+ QRegExUnicode = QRegularExpression.PatternOption.UseUnicodePropertiesOption
116
+
117
+ # Maps
118
+
119
+ FONT_WEIGHTS: dict[int, int] = {
120
+ QFont.Weight.Thin: 100,
121
+ QFont.Weight.ExtraLight: 200,
122
+ QFont.Weight.Light: 300,
123
+ QFont.Weight.Normal: 400,
124
+ QFont.Weight.Medium: 500,
125
+ QFont.Weight.DemiBold: 600,
126
+ QFont.Weight.Bold: 700,
127
+ QFont.Weight.ExtraBold: 800,
128
+ QFont.Weight.Black: 900,
129
+ }
130
+
131
+ FONT_STYLE: dict[int, str] = {
132
+ QFont.Style.StyleNormal: "normal",
133
+ QFont.Style.StyleItalic: "italic",
134
+ QFont.Style.StyleOblique: "oblique",
135
+ }
@@ -1,55 +0,0 @@
1
- """
2
- novelWriter – Custom Widget: Progress Simple
3
- ============================================
4
-
5
- File History:
6
- Created: 2023-06-09 [2.1b1]
7
-
8
- This file is a part of novelWriter
9
- Copyright 2018–2024, Veronica Berglyd Olsen
10
-
11
- This program is free software: you can redistribute it and/or modify
12
- it under the terms of the GNU General Public License as published by
13
- the Free Software Foundation, either version 3 of the License, or
14
- (at your option) any later version.
15
-
16
- This program is distributed in the hope that it will be useful, but
17
- WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
- General Public License for more details.
20
-
21
- You should have received a copy of the GNU General Public License
22
- along with this program. If not, see <https://www.gnu.org/licenses/>.
23
- """
24
- from __future__ import annotations
25
-
26
- from math import ceil
27
-
28
- from PyQt5.QtGui import QPaintEvent, QPainter
29
- from PyQt5.QtWidgets import QProgressBar, QWidget
30
-
31
- from novelwriter.types import QtPaintAnitAlias
32
-
33
-
34
- class NProgressSimple(QProgressBar):
35
- """Extension: Simple Progress Widget
36
-
37
- A custom widget that paints a plain bar with no other styling.
38
- """
39
-
40
- def __init__(self, parent: QWidget) -> None:
41
- super().__init__(parent=parent)
42
- return
43
-
44
- def paintEvent(self, event: QPaintEvent) -> None:
45
- """Custom painter for the progress bar."""
46
- if (value := self.value()) > 0:
47
- progress = ceil(self.width()*float(value)/self.maximum())
48
- painter = QPainter(self)
49
- painter.setRenderHint(QtPaintAnitAlias, True)
50
- painter.setPen(self.palette().highlight().color())
51
- painter.setBrush(self.palette().highlight())
52
- painter.drawRect(0, 0, progress, self.height())
53
- return
54
-
55
- # END Class NProgressSimple