novelWriter 2.2b1__py3-none-any.whl → 2.2.1__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 (134) hide show
  1. {novelWriter-2.2b1.dist-info → novelWriter-2.2.1.dist-info}/METADATA +3 -3
  2. {novelWriter-2.2b1.dist-info → novelWriter-2.2.1.dist-info}/RECORD +128 -114
  3. {novelWriter-2.2b1.dist-info → novelWriter-2.2.1.dist-info}/WHEEL +1 -1
  4. novelwriter/__init__.py +10 -5
  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_zh_CN.qm +0 -0
  13. novelwriter/assets/i18n/project_de_DE.json +1 -0
  14. novelwriter/assets/i18n/project_en_GB.json +1 -0
  15. novelwriter/assets/i18n/project_en_US.json +1 -0
  16. novelwriter/assets/i18n/project_es_419.json +11 -0
  17. novelwriter/assets/i18n/project_fr_FR.json +11 -0
  18. novelwriter/assets/i18n/project_it_IT.json +11 -0
  19. novelwriter/assets/i18n/project_ja_JP.json +2 -1
  20. novelwriter/assets/i18n/project_nb_NO.json +1 -0
  21. novelwriter/assets/i18n/project_zh_CN.json +11 -0
  22. novelwriter/assets/icons/novelwriter.ico +0 -0
  23. novelwriter/assets/icons/typicons_dark/icons.conf +11 -3
  24. novelwriter/assets/icons/typicons_dark/nw_deco-h2-narrow.svg +4 -0
  25. novelwriter/assets/icons/typicons_dark/nw_deco-h3-narrow.svg +4 -0
  26. novelwriter/assets/icons/typicons_dark/nw_deco-h4-narrow.svg +4 -0
  27. novelwriter/assets/icons/typicons_dark/nw_deco-note.svg +4 -0
  28. novelwriter/assets/icons/typicons_dark/nw_panel.svg +4 -0
  29. novelwriter/assets/icons/typicons_dark/nw_tb-bold-md.svg +4 -0
  30. novelwriter/assets/icons/typicons_dark/nw_tb-bold.svg +3 -1
  31. novelwriter/assets/icons/typicons_dark/nw_tb-italic-md.svg +4 -0
  32. novelwriter/assets/icons/typicons_dark/nw_tb-italic.svg +3 -1
  33. novelwriter/assets/icons/typicons_dark/nw_tb-strike-md.svg +4 -0
  34. novelwriter/assets/icons/typicons_dark/nw_tb-strike.svg +3 -1
  35. novelwriter/assets/icons/typicons_dark/nw_tb-subscript.svg +4 -2
  36. novelwriter/assets/icons/typicons_dark/nw_tb-superscript.svg +4 -2
  37. novelwriter/assets/icons/typicons_dark/nw_tb-underline.svg +4 -2
  38. novelwriter/assets/icons/typicons_dark/typ_eye.svg +4 -0
  39. novelwriter/assets/icons/typicons_light/icons.conf +11 -3
  40. novelwriter/assets/icons/typicons_light/nw_deco-h2-narrow.svg +4 -0
  41. novelwriter/assets/icons/typicons_light/nw_deco-h3-narrow.svg +4 -0
  42. novelwriter/assets/icons/typicons_light/nw_deco-h4-narrow.svg +4 -0
  43. novelwriter/assets/icons/typicons_light/nw_deco-note.svg +4 -0
  44. novelwriter/assets/icons/typicons_light/nw_panel.svg +4 -0
  45. novelwriter/assets/icons/typicons_light/nw_tb-bold-md.svg +4 -0
  46. novelwriter/assets/icons/typicons_light/nw_tb-bold.svg +3 -1
  47. novelwriter/assets/icons/typicons_light/nw_tb-italic-md.svg +4 -0
  48. novelwriter/assets/icons/typicons_light/nw_tb-italic.svg +3 -1
  49. novelwriter/assets/icons/typicons_light/nw_tb-strike-md.svg +4 -0
  50. novelwriter/assets/icons/typicons_light/nw_tb-strike.svg +3 -1
  51. novelwriter/assets/icons/typicons_light/nw_tb-subscript.svg +4 -2
  52. novelwriter/assets/icons/typicons_light/nw_tb-superscript.svg +4 -2
  53. novelwriter/assets/icons/typicons_light/nw_tb-underline.svg +4 -2
  54. novelwriter/assets/icons/typicons_light/typ_eye.svg +4 -0
  55. novelwriter/assets/icons/x-novelwriter-project.ico +0 -0
  56. novelwriter/assets/manual.pdf +0 -0
  57. novelwriter/assets/sample.zip +0 -0
  58. novelwriter/assets/text/release_notes.htm +50 -7
  59. novelwriter/common.py +35 -27
  60. novelwriter/config.py +13 -28
  61. novelwriter/constants.py +21 -4
  62. novelwriter/core/buildsettings.py +2 -2
  63. novelwriter/core/coretools.py +8 -2
  64. novelwriter/core/docbuild.py +1 -1
  65. novelwriter/core/document.py +1 -1
  66. novelwriter/core/index.py +102 -36
  67. novelwriter/core/item.py +2 -2
  68. novelwriter/core/options.py +6 -3
  69. novelwriter/core/project.py +5 -5
  70. novelwriter/core/projectdata.py +3 -3
  71. novelwriter/core/projectxml.py +1 -1
  72. novelwriter/core/sessions.py +2 -2
  73. novelwriter/core/spellcheck.py +4 -3
  74. novelwriter/core/status.py +3 -3
  75. novelwriter/core/storage.py +1 -1
  76. novelwriter/core/tohtml.py +11 -5
  77. novelwriter/core/tokenizer.py +28 -21
  78. novelwriter/core/tomd.py +6 -2
  79. novelwriter/core/toodt.py +12 -5
  80. novelwriter/core/tree.py +2 -2
  81. novelwriter/dialogs/about.py +30 -31
  82. novelwriter/dialogs/docmerge.py +24 -15
  83. novelwriter/dialogs/docsplit.py +27 -16
  84. novelwriter/dialogs/editlabel.py +19 -7
  85. novelwriter/dialogs/preferences.py +116 -131
  86. novelwriter/dialogs/projdetails.py +29 -36
  87. novelwriter/dialogs/projload.py +32 -36
  88. novelwriter/dialogs/projsettings.py +20 -15
  89. novelwriter/dialogs/quotes.py +32 -25
  90. novelwriter/dialogs/updates.py +17 -16
  91. novelwriter/dialogs/wordlist.py +34 -21
  92. novelwriter/enum.py +19 -8
  93. novelwriter/error.py +1 -1
  94. novelwriter/extensions/circularprogress.py +1 -1
  95. novelwriter/extensions/configlayout.py +3 -15
  96. novelwriter/extensions/{wheeleventfilter.py → eventfilters.py} +15 -5
  97. novelwriter/extensions/novelselector.py +1 -1
  98. novelwriter/extensions/pageddialog.py +1 -1
  99. novelwriter/extensions/pagedsidebar.py +2 -5
  100. novelwriter/extensions/simpleprogress.py +8 -9
  101. novelwriter/extensions/statusled.py +1 -1
  102. novelwriter/extensions/switch.py +4 -4
  103. novelwriter/extensions/switchbox.py +1 -6
  104. novelwriter/gui/doceditor.py +349 -236
  105. novelwriter/gui/dochighlight.py +10 -11
  106. novelwriter/gui/docviewer.py +158 -360
  107. novelwriter/gui/docviewerpanel.py +502 -0
  108. novelwriter/gui/editordocument.py +4 -4
  109. novelwriter/gui/itemdetails.py +2 -2
  110. novelwriter/gui/mainmenu.py +50 -36
  111. novelwriter/gui/noveltree.py +44 -53
  112. novelwriter/gui/outline.py +12 -7
  113. novelwriter/gui/projtree.py +465 -381
  114. novelwriter/gui/sidebar.py +9 -7
  115. novelwriter/gui/statusbar.py +48 -5
  116. novelwriter/gui/theme.py +26 -8
  117. novelwriter/guimain.py +212 -208
  118. novelwriter/shared.py +76 -30
  119. novelwriter/tools/dictionaries.py +268 -0
  120. novelwriter/tools/lipsum.py +34 -28
  121. novelwriter/tools/manusbuild.py +20 -10
  122. novelwriter/tools/manuscript.py +20 -27
  123. novelwriter/tools/manussettings.py +2 -4
  124. novelwriter/tools/projwizard.py +3 -3
  125. novelwriter/tools/writingstats.py +18 -5
  126. novelwriter/assets/icons/typicons_dark/nw_tb-markdown.svg +0 -8
  127. novelwriter/assets/icons/typicons_dark/nw_tb-shortcode.svg +0 -8
  128. novelwriter/assets/icons/typicons_dark/typ_at.svg +0 -4
  129. novelwriter/assets/icons/typicons_light/nw_tb-markdown.svg +0 -8
  130. novelwriter/assets/icons/typicons_light/nw_tb-shortcode.svg +0 -8
  131. novelwriter/assets/icons/typicons_light/typ_at.svg +0 -4
  132. {novelWriter-2.2b1.dist-info → novelWriter-2.2.1.dist-info}/LICENSE.md +0 -0
  133. {novelWriter-2.2b1.dist-info → novelWriter-2.2.1.dist-info}/entry_points.txt +0 -0
  134. {novelWriter-2.2b1.dist-info → novelWriter-2.2.1.dist-info}/top_level.txt +0 -0
@@ -3,10 +3,10 @@ novelWriter – GUI User Wordlist
3
3
  ===============================
4
4
 
5
5
  File History:
6
- Created: 2021-02-12 [1.2rc1]
6
+ Created: 2021-02-12 [1.2rc1] GuiWordList
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -27,10 +27,11 @@ import logging
27
27
 
28
28
  from typing import TYPE_CHECKING
29
29
 
30
- from PyQt5.QtCore import Qt
30
+ from PyQt5.QtGui import QCloseEvent
31
+ from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot
31
32
  from PyQt5.QtWidgets import (
32
33
  QAbstractItemView, QDialog, QDialogButtonBox, QHBoxLayout, QLabel,
33
- QLineEdit, QListWidget, QListWidgetItem, QPushButton, QVBoxLayout
34
+ QLineEdit, QListWidget, QListWidgetItem, QPushButton, QVBoxLayout, qApp
34
35
  )
35
36
 
36
37
  from novelwriter import CONFIG, SHARED
@@ -44,7 +45,9 @@ logger = logging.getLogger(__name__)
44
45
 
45
46
  class GuiWordList(QDialog):
46
47
 
47
- def __init__(self, mainGui: GuiMain):
48
+ newWordListReady = pyqtSignal()
49
+
50
+ def __init__(self, mainGui: GuiMain) -> None:
48
51
  super().__init__(parent=mainGui)
49
52
 
50
53
  logger.debug("Create: GuiWordList")
@@ -87,7 +90,7 @@ class GuiWordList(QDialog):
87
90
 
88
91
  self.buttonBox = QDialogButtonBox(QDialogButtonBox.Save | QDialogButtonBox.Close)
89
92
  self.buttonBox.accepted.connect(self._doSave)
90
- self.buttonBox.rejected.connect(self._doClose)
93
+ self.buttonBox.rejected.connect(self.close)
91
94
 
92
95
  # Assemble
93
96
  # ========
@@ -108,15 +111,27 @@ class GuiWordList(QDialog):
108
111
 
109
112
  return
110
113
 
111
- def __del__(self): # pragma: no cover
114
+ def __del__(self) -> None: # pragma: no cover
112
115
  logger.debug("Delete: GuiWordList")
113
116
  return
114
117
 
115
118
  ##
116
- # Slots
119
+ # Events
120
+ ##
121
+
122
+ def closeEvent(self, event: QCloseEvent) -> None:
123
+ """Capture the close event and perform cleanup."""
124
+ self._saveGuiSettings()
125
+ event.accept()
126
+ self.deleteLater()
127
+ return
128
+
129
+ ##
130
+ # Private Slots
117
131
  ##
118
132
 
119
- def _doAdd(self):
133
+ @pyqtSlot()
134
+ def _doAdd(self) -> None:
120
135
  """Add a new word to the word list."""
121
136
  word = self.newEntry.text().strip()
122
137
  if word == "":
@@ -134,16 +149,17 @@ class GuiWordList(QDialog):
134
149
 
135
150
  return
136
151
 
137
- def _doDelete(self):
152
+ @pyqtSlot()
153
+ def _doDelete(self) -> None:
138
154
  """Delete the selected item."""
139
155
  selItem = self.listBox.selectedItems()
140
156
  if selItem:
141
157
  self.listBox.takeItem(self.listBox.row(selItem[0]))
142
158
  return
143
159
 
144
- def _doSave(self):
160
+ @pyqtSlot()
161
+ def _doSave(self) -> None:
145
162
  """Save the new word list and close."""
146
- self._saveGuiSettings()
147
163
  userDict = UserDictionary(SHARED.project)
148
164
  for i in range(self.listBox.count()):
149
165
  item = self.listBox.item(i)
@@ -152,20 +168,16 @@ class GuiWordList(QDialog):
152
168
  if word:
153
169
  userDict.add(word)
154
170
  userDict.save()
155
- self.accept()
156
- return True
157
-
158
- def _doClose(self):
159
- """Close without saving the word list."""
160
- self._saveGuiSettings()
161
- self.reject()
171
+ self.newWordListReady.emit()
172
+ qApp.processEvents()
173
+ self.close()
162
174
  return
163
175
 
164
176
  ##
165
177
  # Internal Functions
166
178
  ##
167
179
 
168
- def _loadWordList(self):
180
+ def _loadWordList(self) -> None:
169
181
  """Load the project's word list, if it exists."""
170
182
  userDict = UserDictionary(SHARED.project)
171
183
  userDict.load()
@@ -175,11 +187,12 @@ class GuiWordList(QDialog):
175
187
  self.listBox.addItem(word)
176
188
  return
177
189
 
178
- def _saveGuiSettings(self):
190
+ def _saveGuiSettings(self) -> None:
179
191
  """Save GUI settings."""
180
192
  winWidth = CONFIG.rpxInt(self.width())
181
193
  winHeight = CONFIG.rpxInt(self.height())
182
194
 
195
+ logger.debug("Saving State: GuiWordList")
183
196
  pOptions = SHARED.project.options
184
197
  pOptions.setValue("GuiWordList", "winWidth", winWidth)
185
198
  pOptions.setValue("GuiWordList", "winHeight", winHeight)
novelwriter/enum.py CHANGED
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2018-11-02 [0.0.1]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -61,10 +61,19 @@ class nwItemLayout(Enum):
61
61
  # END Enum nwItemLayout
62
62
 
63
63
 
64
+ class nwComment(Enum):
65
+
66
+ PLAIN = 0
67
+ SYNOPSIS = 1
68
+ SHORT = 2
69
+
70
+ # END Enum nwComment
71
+
72
+
64
73
  class nwTrinary(Enum):
65
74
 
66
75
  NEGATIVE = -1
67
- UNKNOWN = 0
76
+ NEUTRAL = 0
68
77
  POSITIVE = 1
69
78
 
70
79
  # END Enum nwTrinary
@@ -86,9 +95,9 @@ class nwDocAction(Enum):
86
95
  CUT = 3
87
96
  COPY = 4
88
97
  PASTE = 5
89
- EMPH = 6
90
- STRONG = 7
91
- STRIKE = 8
98
+ MD_ITALIC = 6
99
+ MD_BOLD = 7
100
+ MD_STRIKE = 8
92
101
  S_QUOTE = 9
93
102
  D_QUOTE = 10
94
103
  SEL_ALL = 11
@@ -127,9 +136,11 @@ class nwDocInsert(Enum):
127
136
  QUOTE_LD = 3
128
137
  QUOTE_RD = 4
129
138
  SYNOPSIS = 5
130
- NEW_PAGE = 6
131
- VSPACE_S = 7
132
- VSPACE_M = 8
139
+ SHORT = 6
140
+ NEW_PAGE = 7
141
+ VSPACE_S = 8
142
+ VSPACE_M = 9
143
+ LIPSUM = 10
133
144
 
134
145
  # END Enum nwDocInsert
135
146
 
novelwriter/error.py CHANGED
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2020-08-02 [0.10.2]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2023-06-07 [2.1b1]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2020-05-03 [0.4.5]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -59,10 +59,7 @@ class NConfigLayout(QGridLayout):
59
59
  def setHelpTextStyle(self, color: QColor | list | tuple,
60
60
  fontScale: float = FONT_SCALE) -> None:
61
61
  """Set the text color for the help text."""
62
- if isinstance(color, QColor):
63
- self._helpCol = color
64
- else:
65
- self._helpCol = QColor(*color)
62
+ self._helpCol = color if isinstance(color, QColor) else QColor(*color)
66
63
  self._fontScale = fontScale
67
64
  return
68
65
 
@@ -74,12 +71,6 @@ class NConfigLayout(QGridLayout):
74
71
  qHelp.setText(text)
75
72
  return
76
73
 
77
- def setLabelText(self, row: int, text: str) -> None:
78
- """Set the text for the main label."""
79
- if row in self._itemMap:
80
- self._itemMap[row](0).setText(text)
81
- return
82
-
83
74
  ##
84
75
  # Class Methods
85
76
  ##
@@ -211,10 +202,7 @@ class NHelpLabel(QLabel):
211
202
  fontSize: float = FONT_SCALE) -> None:
212
203
  super().__init__(text)
213
204
 
214
- if isinstance(color, QColor):
215
- qCol = color
216
- else:
217
- qCol = QColor(*color)
205
+ qCol = color if isinstance(color, QColor) else QColor(*color)
218
206
 
219
207
  lblCol = self.palette()
220
208
  lblCol.setColor(QPalette.WindowText, qCol)
@@ -1,12 +1,13 @@
1
1
  """
2
- novelWriter – Custom Object: Wheel Event Filter
3
- ===============================================
2
+ novelWriter – Custom Objects: Event Filters
3
+ ===========================================
4
4
 
5
5
  File History:
6
- Created: 2023-08-31 [2.1rc1]
6
+ Created: 2023-08-31 [2.1rc1] WheelEventFilter
7
+ Created: 2023-11-28 [2.2] StatusTipFilter
7
8
 
8
9
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
10
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
11
 
11
12
  This program is free software: you can redistribute it and/or modify
12
13
  it under the terms of the GNU General Public License as published by
@@ -23,7 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
23
24
  """
24
25
  from __future__ import annotations
25
26
 
26
- from PyQt5.QtGui import QWheelEvent
27
+ from PyQt5.QtGui import QStatusTipEvent, QWheelEvent
27
28
  from PyQt5.QtCore import QEvent, QObject
28
29
  from PyQt5.QtWidgets import QWidget
29
30
 
@@ -63,3 +64,12 @@ class WheelEventFilter(QObject):
63
64
  return False
64
65
 
65
66
  # END Class WheelEventFilter
67
+
68
+
69
+ class StatusTipFilter(QObject):
70
+
71
+ def eventFilter(self, obj: QObject, event: QEvent) -> bool:
72
+ """Filter out status tip events on menus."""
73
+ return True if isinstance(event, QStatusTipEvent) else super().eventFilter(obj, event)
74
+
75
+ # END Class StatusTipFilter
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2022-11-17 [2.0]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2020-05-17 [0.5.1]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -8,7 +8,7 @@ Created: 2023-02-21 [2.1b1] NPagedToolButton
8
8
  Created: 2023-02-21 [2.1b1] NPagedToolLabel
9
9
 
10
10
  This file is a part of novelWriter
11
- Copyright 2018–2023, Veronica Berglyd Olsen
11
+ Copyright 2018–2024, Veronica Berglyd Olsen
12
12
 
13
13
  This program is free software: you can redistribute it and/or modify
14
14
  it under the terms of the GNU General Public License as published by
@@ -65,10 +65,7 @@ class NPagedSideBar(QToolBar):
65
65
 
66
66
  def setLabelColor(self, color: list | QColor) -> None:
67
67
  """Set the text color for the labels."""
68
- if isinstance(color, list):
69
- self._labelCol = QColor(*color)
70
- elif isinstance(color, QColor):
71
- self._labelCol = color
68
+ self._labelCol = color if isinstance(color, QColor) else QColor(*color)
72
69
  return
73
70
 
74
71
  def addSeparator(self) -> None:
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2023-06-09 [2.1b1]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -41,14 +41,13 @@ class NProgressSimple(QProgressBar):
41
41
 
42
42
  def paintEvent(self, event: QPaintEvent) -> None:
43
43
  """Custom painter for the progress bar."""
44
- if self.value() == 0:
45
- return
46
- progress = ceil(self.width()*float(self.value())/self.maximum())
47
- qPaint = QPainter(self)
48
- qPaint.setRenderHint(QPainter.Antialiasing, True)
49
- qPaint.setPen(self.palette().highlight().color())
50
- qPaint.setBrush(self.palette().highlight())
51
- qPaint.drawRect(0, 0, progress, self.height())
44
+ if (value := self.value()) > 0:
45
+ progress = ceil(self.width()*float(value)/self.maximum())
46
+ qPaint = QPainter(self)
47
+ qPaint.setRenderHint(QPainter.Antialiasing, True)
48
+ qPaint.setPen(self.palette().highlight().color())
49
+ qPaint.setBrush(self.palette().highlight())
50
+ qPaint.drawRect(0, 0, progress, self.height())
52
51
  return
53
52
 
54
53
  # END Class NProgressSimple
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2020-05-17 [0.5.1]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2020-05-03 [0.4.5]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -134,10 +134,10 @@ class NSwitch(QAbstractButton):
134
134
  qPaint.setBrush(thumbBrush)
135
135
  qPaint.drawEllipse(self._offset - self._rR, self._rB, self._rH, self._rH)
136
136
 
137
- theFont = qPaint.font()
138
- theFont.setPixelSize(self._xT)
137
+ font = qPaint.font()
138
+ font.setPixelSize(self._xT)
139
139
  qPaint.setPen(textColor)
140
- qPaint.setFont(theFont)
140
+ qPaint.setFont(font)
141
141
  qPaint.drawText(
142
142
  QRectF(self._offset - self._rR, self._rB, self._rH, self._rH),
143
143
  Qt.AlignCenter, thumbText
@@ -6,7 +6,7 @@ File History:
6
6
  Created: 2023-04-16 [2.1b1]
7
7
 
8
8
  This file is a part of novelWriter
9
- Copyright 2018–2023, Veronica Berglyd Olsen
9
+ Copyright 2018–2024, Veronica Berglyd Olsen
10
10
 
11
11
  This program is free software: you can redistribute it and/or modify
12
12
  it under the terms of the GNU General Public License as published by
@@ -106,11 +106,6 @@ class NSwitchBox(QScrollArea):
106
106
  self._bumpIndex()
107
107
  return
108
108
 
109
- def setInnerContentsMargins(self, left: int, top: int, right: int, bottom: int) -> None:
110
- """Set the contents margins of the inner layout."""
111
- self._content.setContentsMargins(left, top, right, bottom)
112
- return
113
-
114
109
  ##
115
110
  # Internal Functions
116
111
  ##