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.
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/METADATA +4 -5
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/RECORD +109 -101
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/WHEEL +1 -1
- novelwriter/__init__.py +33 -39
- novelwriter/assets/i18n/project_en_GB.json +1 -0
- novelwriter/assets/icons/typicons_dark/icons.conf +2 -0
- novelwriter/assets/icons/typicons_dark/nw_font.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_quote.svg +4 -0
- novelwriter/assets/icons/typicons_light/icons.conf +2 -0
- novelwriter/assets/icons/typicons_light/nw_font.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_quote.svg +4 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +5 -3
- novelwriter/assets/syntax/default_dark.conf +32 -18
- novelwriter/assets/syntax/default_light.conf +24 -10
- novelwriter/assets/syntax/dracula.conf +44 -0
- novelwriter/assets/syntax/grey_dark.conf +5 -4
- novelwriter/assets/syntax/grey_light.conf +5 -4
- novelwriter/assets/syntax/light_owl.conf +7 -6
- novelwriter/assets/syntax/night_owl.conf +7 -6
- novelwriter/assets/syntax/snazzy.conf +42 -0
- novelwriter/assets/syntax/solarized_dark.conf +4 -3
- novelwriter/assets/syntax/solarized_light.conf +4 -3
- novelwriter/assets/syntax/tango.conf +27 -11
- novelwriter/assets/syntax/tomorrow.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night.conf +7 -6
- novelwriter/assets/syntax/tomorrow_night_blue.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night_bright.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night_eighties.conf +6 -5
- novelwriter/assets/text/credits_en.htm +4 -1
- novelwriter/assets/themes/cyberpunk_night.conf +3 -0
- novelwriter/assets/themes/default_dark.conf +2 -0
- novelwriter/assets/themes/default_light.conf +2 -0
- novelwriter/assets/themes/dracula.conf +48 -0
- novelwriter/assets/themes/solarized_dark.conf +2 -0
- novelwriter/assets/themes/solarized_light.conf +2 -0
- novelwriter/common.py +33 -12
- novelwriter/config.py +184 -98
- novelwriter/constants.py +47 -35
- novelwriter/core/buildsettings.py +68 -69
- novelwriter/core/coretools.py +5 -23
- novelwriter/core/docbuild.py +52 -40
- novelwriter/core/document.py +3 -5
- novelwriter/core/index.py +115 -45
- novelwriter/core/item.py +8 -19
- novelwriter/core/options.py +2 -4
- novelwriter/core/project.py +23 -57
- novelwriter/core/projectdata.py +1 -3
- novelwriter/core/projectxml.py +12 -15
- novelwriter/core/sessions.py +3 -5
- novelwriter/core/spellcheck.py +4 -9
- novelwriter/core/status.py +211 -164
- novelwriter/core/storage.py +0 -8
- novelwriter/core/tohtml.py +139 -105
- novelwriter/core/tokenizer.py +278 -122
- novelwriter/core/{tomd.py → tomarkdown.py} +97 -78
- novelwriter/core/toodt.py +257 -166
- novelwriter/core/toqdoc.py +419 -0
- novelwriter/core/tree.py +5 -7
- novelwriter/dialogs/about.py +11 -18
- novelwriter/dialogs/docmerge.py +17 -19
- novelwriter/dialogs/docsplit.py +17 -19
- novelwriter/dialogs/editlabel.py +6 -10
- novelwriter/dialogs/preferences.py +193 -144
- novelwriter/dialogs/projectsettings.py +225 -189
- novelwriter/dialogs/quotes.py +12 -9
- novelwriter/dialogs/wordlist.py +9 -15
- novelwriter/enum.py +35 -30
- novelwriter/error.py +8 -15
- novelwriter/extensions/configlayout.py +40 -21
- novelwriter/extensions/eventfilters.py +1 -5
- novelwriter/extensions/modified.py +58 -14
- novelwriter/extensions/novelselector.py +1 -3
- novelwriter/extensions/pagedsidebar.py +9 -12
- novelwriter/extensions/{circularprogress.py → progressbars.py} +30 -8
- novelwriter/extensions/statusled.py +29 -25
- novelwriter/extensions/switch.py +4 -6
- novelwriter/extensions/switchbox.py +7 -6
- novelwriter/extensions/versioninfo.py +3 -9
- novelwriter/gui/doceditor.py +118 -137
- novelwriter/gui/dochighlight.py +231 -186
- novelwriter/gui/docviewer.py +66 -107
- novelwriter/gui/docviewerpanel.py +3 -10
- novelwriter/gui/editordocument.py +1 -3
- novelwriter/gui/itemdetails.py +7 -11
- novelwriter/gui/mainmenu.py +22 -18
- novelwriter/gui/noveltree.py +11 -24
- novelwriter/gui/outline.py +14 -26
- novelwriter/gui/projtree.py +35 -60
- novelwriter/gui/search.py +10 -3
- novelwriter/gui/sidebar.py +2 -6
- novelwriter/gui/statusbar.py +29 -37
- novelwriter/gui/theme.py +26 -48
- novelwriter/guimain.py +134 -148
- novelwriter/shared.py +36 -32
- novelwriter/text/patterns.py +113 -0
- novelwriter/tools/dictionaries.py +10 -20
- novelwriter/tools/lipsum.py +10 -16
- novelwriter/tools/manusbuild.py +9 -11
- novelwriter/tools/manuscript.py +71 -145
- novelwriter/tools/manussettings.py +71 -75
- novelwriter/tools/noveldetails.py +16 -21
- novelwriter/tools/welcome.py +12 -26
- novelwriter/tools/writingstats.py +9 -12
- novelwriter/types.py +49 -4
- novelwriter/extensions/simpleprogress.py +0 -55
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/entry_points.txt +0 -0
- {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
|
-
|
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
|
File without changes
|
File without changes
|
File without changes
|