novelWriter 2.4.2__py3-none-any.whl → 2.4.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: novelWriter
3
- Version: 2.4.2
3
+ Version: 2.4.3
4
4
  Summary: A markdown-like text editor for planning and writing novels
5
5
  Author-email: Veronica Berglyd Olsen <code@vkbo.net>
6
6
  License: GNU General Public License v3
@@ -1,4 +1,4 @@
1
- novelwriter/__init__.py,sha256=UmO-iWGbt0mkX0Qp5ec2ApSn1aDEmkgg-632e_ICZrU,7744
1
+ novelwriter/__init__.py,sha256=69BrinWVwpxf8bcMPBuzGtiq4dcE08ewmw29fgV4txA,7744
2
2
  novelwriter/common.py,sha256=oarn4-2Ezm595b-dHD4MVrytxMFFB_QhITbTMIKD40M,17440
3
3
  novelwriter/config.py,sha256=Y0c3-0xfmDE-IDcFYW0U_x_WGPMoU2T0sqtNZ8CT4zQ,35841
4
4
  novelwriter/constants.py,sha256=UIxiF-23cB_gmRfxbQPYmObn8Ib-ygm46uOIG329RLY,19818
@@ -7,8 +7,8 @@ novelwriter/error.py,sha256=rY3kHVkt7W0MM9iKOBkMY-9qhStlESGlyeOOXwT4BGM,7278
7
7
  novelwriter/guimain.py,sha256=Be32lkJv1ZF-aOSOQTPBfcH7TFrk3KvpLBmwIl20eRc,53477
8
8
  novelwriter/shared.py,sha256=t-0ZwgnT7KNHDtz4fBV-uPxh9P0Nw1R0Sj-VW4To6sc,14678
9
9
  novelwriter/types.py,sha256=6aP2hZraPEolYqBgj5R_5bah3NgelASBfKol6yYOi4g,3316
10
- novelwriter/assets/manual.pdf,sha256=kMZhZUq4Nl-haKrsBVIjh75k55zEydBMjbUeKfUYKQ8,2691208
11
- novelwriter/assets/sample.zip,sha256=1JF3NFAoBjJIhycpXLPzPTbfTDEiKznKN4O3uX8NI6U,27360
10
+ novelwriter/assets/manual.pdf,sha256=5Z8uh-G3UDm1medGpg8JG1o7DuQF2OWeRGy4QBWmTDc,2691354
11
+ novelwriter/assets/sample.zip,sha256=zO0QrKdMr0-SeLG6QizMe50F3SDpe4EkFz4CRgDl2Yg,27358
12
12
  novelwriter/assets/i18n/nw_de_DE.qm,sha256=PPBpHJ3M0jL0t4xSY8zr3CKaO0umGW4K4Tb7bj0gtlA,97532
13
13
  novelwriter/assets/i18n/nw_en_US.qm,sha256=sZKjLkT2CcPhGAS3WUgKm9XO3ugbBrx2zbwVyhP7vSE,90470
14
14
  novelwriter/assets/i18n/nw_es_419.qm,sha256=8saaQ1As_hOgBI-oyEIqV5KCmLaMg_ldkOT9Q1uJmaY,99857
@@ -298,9 +298,9 @@ novelwriter/extensions/statusled.py,sha256=640phDm3ZcLvM9EC_uwVPjG9LD5W3pAjtoqU4
298
298
  novelwriter/extensions/switch.py,sha256=sZBNX5Wj1qkVA6cHh04GjuWOTbejaatHgLZ5yGzXGv4,4346
299
299
  novelwriter/extensions/switchbox.py,sha256=y6yuoCAZYYL7miaFlC8h5ymtuB0Xyk2AMmxAFYOYPDA,4210
300
300
  novelwriter/extensions/versioninfo.py,sha256=eUJzO6eV6SFXgp71uxr9696rjUQctGm84CA7XqxFhGc,5120
301
- novelwriter/gui/doceditor.py,sha256=9UVaPhA_FnroPK6_K-GraygJYojh208qiJd426g27pc,113840
301
+ novelwriter/gui/doceditor.py,sha256=d96MDOqdLb4y8cR25ah5KGZGvfFADPT33bDBd7O7kzA,114599
302
302
  novelwriter/gui/dochighlight.py,sha256=9-OP0YrMmljOCsdY-rqZe0G27gkBP7Fzk_R_f3iGGVE,17394
303
- novelwriter/gui/docviewer.py,sha256=9KvGhEMLqmqibhdIgJ7lmoQ28oTnOfT08sdlBo4WV24,33107
303
+ novelwriter/gui/docviewer.py,sha256=RcvChY8OA5gxHzNi6l3xj60ua_6nPxSQ75_apIgeyDg,33559
304
304
  novelwriter/gui/docviewerpanel.py,sha256=IcQGLN49MmVGfIPg-8IzLGKYn9DbJqfdXWG6jd_JaAI,20009
305
305
  novelwriter/gui/editordocument.py,sha256=jxODONgq80Kf63lRezzbYtyEelaC-GpvgPEMKQ3m_sg,4116
306
306
  novelwriter/gui/itemdetails.py,sha256=VIfWDtn9g0IRBYSDFT_AhZgluQ0d7sK5C14lENyvzHg,9774
@@ -311,19 +311,19 @@ novelwriter/gui/projtree.py,sha256=21B1-NJFYf724oIH5xX0b35YX3YX-zxRcLdYopMdRy8,7
311
311
  novelwriter/gui/search.py,sha256=PYsSIhe77PCuXj1fRXb2_7GF1gxLDv_vyq8JsgW5UfY,12996
312
312
  novelwriter/gui/sidebar.py,sha256=kidGGzXQ5RNQvKuH0kFh-lwoUSlkXffBucEoL15RMd4,6258
313
313
  novelwriter/gui/statusbar.py,sha256=ru-4pyg8owWkwkXGgj5GEupfq9fbIykYwGpomwzaINk,9353
314
- novelwriter/gui/theme.py,sha256=P2EI79WMGulYBhkADqVOWW13DfFOOoCUeBf7Kxku-wM,32670
314
+ novelwriter/gui/theme.py,sha256=ANv1e5KghrB8z-uaHZbc3GZdmcl_or6KOpFhyBbgeX4,32781
315
315
  novelwriter/text/counting.py,sha256=tkWKWS_scPYmBG8xLpIL1KLIjyF2HOlkrloQa5PZmDc,4304
316
- novelwriter/tools/dictionaries.py,sha256=Xy5or2yejJbUv9ptwqsz1-R4pxDYQATiHCZaqorUXdY,9231
316
+ novelwriter/tools/dictionaries.py,sha256=cEdkqXowPZJV9hD01EmYB6PDGsMFYwVQ7QLEt_jthOk,9308
317
317
  novelwriter/tools/lipsum.py,sha256=d-qdRSrXLfTkTdzi7vhjeBlWawwGwWQ9Qd_zRSwzgpQ,4901
318
318
  novelwriter/tools/manusbuild.py,sha256=80kRr4OfvW2lqjhLpnAWO8HiTX7Y3HSivcjT48v_KUE,14101
319
- novelwriter/tools/manuscript.py,sha256=KdQl1xWVSzl9u1TQ1Jb-zWn3jZRwPuRCqh0DY3h1wHs,40236
319
+ novelwriter/tools/manuscript.py,sha256=3rPDqmOEfLNm0-b89MT8ZXGO_xKyFRj7Z97WtI8lV38,40510
320
320
  novelwriter/tools/manussettings.py,sha256=ak4m6cKk8NAg2OmsQJv-x8Ui-jcUtZe-RkyzotXbqRM,55747
321
321
  novelwriter/tools/noveldetails.py,sha256=KoENyz0hH3TlXfRCEJvRTZ0h7ruOgTIv85AgCl1Ur5o,18503
322
322
  novelwriter/tools/welcome.py,sha256=BxORHBPjqumEVNZC7SytE3kUasx01GMOKS5QQSagP-M,27954
323
323
  novelwriter/tools/writingstats.py,sha256=IubrbbLB_Qlnwp9B3muKkeD84xtckPvmTax7E4LnI5g,22797
324
- novelWriter-2.4.2.dist-info/LICENSE.md,sha256=2GirkkLrPfQqx7fACKRJjtKJUegKc8067erGvcDVQHM,32197
325
- novelWriter-2.4.2.dist-info/METADATA,sha256=tGVtHnZQbK2spACdq4VUc3ZGspEmvQO9jFT9Oe6t4Sg,2582
326
- novelWriter-2.4.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
327
- novelWriter-2.4.2.dist-info/entry_points.txt,sha256=YDUG1w361LtLsjD3YhxoTDTwM17JA5-nigjC6j5C74A,45
328
- novelWriter-2.4.2.dist-info/top_level.txt,sha256=wFFEucjEeNC_Ap5ULBuEutg5a1Uc0-YO9uFT5L2naNI,12
329
- novelWriter-2.4.2.dist-info/RECORD,,
324
+ novelWriter-2.4.3.dist-info/LICENSE.md,sha256=2GirkkLrPfQqx7fACKRJjtKJUegKc8067erGvcDVQHM,32197
325
+ novelWriter-2.4.3.dist-info/METADATA,sha256=_vWoqYtsHkZD7do7LnNJQ71Ha8p509_IwWVHw9M5bBY,2582
326
+ novelWriter-2.4.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
327
+ novelWriter-2.4.3.dist-info/entry_points.txt,sha256=YDUG1w361LtLsjD3YhxoTDTwM17JA5-nigjC6j5C74A,45
328
+ novelWriter-2.4.3.dist-info/top_level.txt,sha256=wFFEucjEeNC_Ap5ULBuEutg5a1Uc0-YO9uFT5L2naNI,12
329
+ novelWriter-2.4.3.dist-info/RECORD,,
novelwriter/__init__.py CHANGED
@@ -47,9 +47,9 @@ __license__ = "GPLv3"
47
47
  __author__ = "Veronica Berglyd Olsen"
48
48
  __maintainer__ = "Veronica Berglyd Olsen"
49
49
  __email__ = "code@vkbo.net"
50
- __version__ = "2.4.2"
51
- __hexversion__ = "0x020402f0"
52
- __date__ = "2024-05-18"
50
+ __version__ = "2.4.3"
51
+ __hexversion__ = "0x020403f0"
52
+ __date__ = "2024-05-20"
53
53
  __status__ = "Stable"
54
54
  __domain__ = "novelwriter.io"
55
55
 
Binary file
Binary file
@@ -43,8 +43,8 @@ from PyQt5.QtCore import (
43
43
  pyqtSignal, pyqtSlot
44
44
  )
45
45
  from PyQt5.QtGui import (
46
- QColor, QCursor, QFont, QKeyEvent, QKeySequence, QMouseEvent, QPalette,
47
- QPixmap, QResizeEvent, QTextBlock, QTextCursor, QTextDocument, QTextOption
46
+ QColor, QCursor, QKeyEvent, QKeySequence, QMouseEvent, QPalette, QPixmap,
47
+ QResizeEvent, QTextBlock, QTextCursor, QTextDocument, QTextOption
48
48
  )
49
49
  from PyQt5.QtWidgets import (
50
50
  QAction, QApplication, QFrame, QGridLayout, QHBoxLayout, QLabel, QLineEdit,
@@ -329,10 +329,7 @@ class GuiDocEditor(QPlainTextEdit):
329
329
  SHARED.updateSpellCheckLanguage()
330
330
 
331
331
  # Set font
332
- font = QFont()
333
- font.setFamily(CONFIG.textFont)
334
- font.setPointSize(CONFIG.textSize)
335
- self._qDocument.setDefaultFont(font)
332
+ self.initFont()
336
333
 
337
334
  # Update highlighter settings
338
335
  self._qDocument.syntaxHighlighter.initHighlighter()
@@ -382,6 +379,23 @@ class GuiDocEditor(QPlainTextEdit):
382
379
 
383
380
  return
384
381
 
382
+ def initFont(self) -> None:
383
+ """Set the font of the main widget and sub-widgets. This needs
384
+ special attention since there appears to be a bug in Qt 5.15.3.
385
+ See issues #1862 and #1875.
386
+ """
387
+ font = self.font()
388
+ font.setFamily(CONFIG.textFont)
389
+ font.setPointSize(CONFIG.textSize)
390
+ self.setFont(font)
391
+
392
+ # Reset sub-widget font to GUI font
393
+ self.docHeader.updateFont()
394
+ self.docFooter.updateFont()
395
+ self.docSearch.updateFont()
396
+
397
+ return
398
+
385
399
  def loadText(self, tHandle: str, tLine: int | None = None) -> bool:
386
400
  """Load text from a document into the editor. If we have an I/O
387
401
  error, we must handle this and clear the editor so that we don't
@@ -2396,9 +2410,6 @@ class GuiDocEditSearch(QFrame):
2396
2410
  iSz = SHARED.theme.baseIconSize
2397
2411
  mPx = CONFIG.pxInt(6)
2398
2412
 
2399
- self.boxFont = SHARED.theme.guiFont
2400
- self.boxFont.setPointSizeF(0.9*SHARED.theme.fontPointSize)
2401
-
2402
2413
  self.setContentsMargins(0, 0, 0, 0)
2403
2414
  self.setAutoFillBackground(True)
2404
2415
  self.setFrameStyle(QFrame.Shape.StyledPanel | QFrame.Shadow.Plain)
@@ -2410,12 +2421,10 @@ class GuiDocEditSearch(QFrame):
2410
2421
  # ==========
2411
2422
 
2412
2423
  self.searchBox = QLineEdit(self)
2413
- self.searchBox.setFont(self.boxFont)
2414
2424
  self.searchBox.setPlaceholderText(self.tr("Search for"))
2415
2425
  self.searchBox.returnPressed.connect(self._doSearch)
2416
2426
 
2417
2427
  self.replaceBox = QLineEdit(self)
2418
- self.replaceBox.setFont(self.boxFont)
2419
2428
  self.replaceBox.setPlaceholderText(self.tr("Replace with"))
2420
2429
  self.replaceBox.returnPressed.connect(self._doReplace)
2421
2430
 
@@ -2425,12 +2434,9 @@ class GuiDocEditSearch(QFrame):
2425
2434
  self.searchOpt.setContentsMargins(0, 0, 0, 0)
2426
2435
 
2427
2436
  self.searchLabel = QLabel(self.tr("Search"), self)
2428
- self.searchLabel.setFont(self.boxFont)
2429
2437
  self.searchLabel.setIndent(CONFIG.pxInt(6))
2430
2438
 
2431
2439
  self.resultLabel = QLabel("?/?", self)
2432
- self.resultLabel.setFont(self.boxFont)
2433
- self.resultLabel.setMinimumWidth(SHARED.theme.getTextWidth("?/?", self.boxFont))
2434
2440
 
2435
2441
  self.toggleCase = QAction(self.tr("Case Sensitive"), self)
2436
2442
  self.toggleCase.setCheckable(True)
@@ -2515,6 +2521,7 @@ class GuiDocEditSearch(QFrame):
2515
2521
  self.replaceButton.setVisible(False)
2516
2522
  self.adjustSize()
2517
2523
 
2524
+ self.updateFont()
2518
2525
  self.updateTheme()
2519
2526
 
2520
2527
  logger.debug("Ready: GuiDocEditSearch")
@@ -2598,7 +2605,9 @@ class GuiDocEditSearch(QFrame):
2598
2605
  numCount = f"{lim:n}+" if (resCount or 0) > lim else f"{resCount:n}"
2599
2606
  sCurrRes = "?" if currRes is None else str(currRes)
2600
2607
  sResCount = "?" if resCount is None else numCount
2601
- minWidth = SHARED.theme.getTextWidth(f"{sResCount}//{sResCount}", self.boxFont)
2608
+ minWidth = SHARED.theme.getTextWidth(
2609
+ f"{sResCount}//{sResCount}", SHARED.theme.guiFontSmall
2610
+ )
2602
2611
  self.resultLabel.setText(f"{sCurrRes}/{sResCount}")
2603
2612
  self.resultLabel.setMinimumWidth(minWidth)
2604
2613
  self.adjustSize()
@@ -2609,6 +2618,18 @@ class GuiDocEditSearch(QFrame):
2609
2618
  # Methods
2610
2619
  ##
2611
2620
 
2621
+ def updateFont(self) -> None:
2622
+ """Update the font settings."""
2623
+ self.setFont(SHARED.theme.guiFont)
2624
+ self.searchBox.setFont(SHARED.theme.guiFontSmall)
2625
+ self.replaceBox.setFont(SHARED.theme.guiFontSmall)
2626
+ self.searchLabel.setFont(SHARED.theme.guiFontSmall)
2627
+ self.resultLabel.setFont(SHARED.theme.guiFontSmall)
2628
+ self.resultLabel.setMinimumWidth(
2629
+ SHARED.theme.getTextWidth("?/?", SHARED.theme.guiFontSmall)
2630
+ )
2631
+ return
2632
+
2612
2633
  def updateTheme(self) -> None:
2613
2634
  """Update theme elements."""
2614
2635
  qPalette = QApplication.palette()
@@ -2793,10 +2814,6 @@ class GuiDocEditHeader(QWidget):
2793
2814
  self.itemTitle.setAlignment(QtAlignCenterTop)
2794
2815
  self.itemTitle.setFixedHeight(iPx)
2795
2816
 
2796
- lblFont = self.itemTitle.font()
2797
- lblFont.setPointSizeF(0.9*SHARED.theme.fontPointSize)
2798
- self.itemTitle.setFont(lblFont)
2799
-
2800
2817
  # Other Widgets
2801
2818
  self.outlineMenu = QMenu(self)
2802
2819
 
@@ -2850,6 +2867,7 @@ class GuiDocEditHeader(QWidget):
2850
2867
  self.setContentsMargins(0, 0, 0, 0)
2851
2868
  self.setMinimumHeight(iPx + 2*mPx)
2852
2869
 
2870
+ self.updateFont()
2853
2871
  self.updateTheme()
2854
2872
 
2855
2873
  logger.debug("Ready: GuiDocEditHeader")
@@ -2888,6 +2906,12 @@ class GuiDocEditHeader(QWidget):
2888
2906
  logger.debug("Document outline updated in %.3f ms", 1000*(time() - tStart))
2889
2907
  return
2890
2908
 
2909
+ def updateFont(self) -> None:
2910
+ """Update the font settings."""
2911
+ self.setFont(SHARED.theme.guiFont)
2912
+ self.itemTitle.setFont(SHARED.theme.guiFontSmall)
2913
+ return
2914
+
2891
2915
  def updateTheme(self) -> None:
2892
2916
  """Update theme elements."""
2893
2917
  self.tbButton.setThemeIcon("menu")
@@ -3001,9 +3025,6 @@ class GuiDocEditFooter(QWidget):
3001
3025
  bSp = CONFIG.pxInt(4)
3002
3026
  hSp = CONFIG.pxInt(6)
3003
3027
 
3004
- lblFont = self.font()
3005
- lblFont.setPointSizeF(0.9*SHARED.theme.fontPointSize)
3006
-
3007
3028
  # Cached Translations
3008
3029
  self._trLineCount = self.tr("Line: {0} ({1})")
3009
3030
  self._trWordCount = self.tr("Words: {0} ({1})")
@@ -3026,7 +3047,6 @@ class GuiDocEditFooter(QWidget):
3026
3047
  self.statusText.setAutoFillBackground(True)
3027
3048
  self.statusText.setFixedHeight(fPx)
3028
3049
  self.statusText.setAlignment(QtAlignLeftTop)
3029
- self.statusText.setFont(lblFont)
3030
3050
 
3031
3051
  # Lines
3032
3052
  self.linesIcon = QLabel("", self)
@@ -3041,7 +3061,6 @@ class GuiDocEditFooter(QWidget):
3041
3061
  self.linesText.setAutoFillBackground(True)
3042
3062
  self.linesText.setFixedHeight(fPx)
3043
3063
  self.linesText.setAlignment(QtAlignLeftTop)
3044
- self.linesText.setFont(lblFont)
3045
3064
 
3046
3065
  # Words
3047
3066
  self.wordsIcon = QLabel("", self)
@@ -3056,7 +3075,6 @@ class GuiDocEditFooter(QWidget):
3056
3075
  self.wordsText.setAutoFillBackground(True)
3057
3076
  self.wordsText.setFixedHeight(fPx)
3058
3077
  self.wordsText.setAlignment(QtAlignLeftTop)
3059
- self.wordsText.setFont(lblFont)
3060
3078
 
3061
3079
  # Assemble Layout
3062
3080
  self.outerBox = QHBoxLayout()
@@ -3079,6 +3097,7 @@ class GuiDocEditFooter(QWidget):
3079
3097
  self.setMinimumHeight(fPx + 2*mPx)
3080
3098
 
3081
3099
  # Fix the Colours
3100
+ self.updateFont()
3082
3101
  self.updateTheme()
3083
3102
 
3084
3103
  # Initialise Info
@@ -3092,6 +3111,14 @@ class GuiDocEditFooter(QWidget):
3092
3111
  # Methods
3093
3112
  ##
3094
3113
 
3114
+ def updateFont(self) -> None:
3115
+ """Update the font settings."""
3116
+ self.setFont(SHARED.theme.guiFont)
3117
+ self.statusText.setFont(SHARED.theme.guiFontSmall)
3118
+ self.linesText.setFont(SHARED.theme.guiFontSmall)
3119
+ self.wordsText.setFont(SHARED.theme.guiFontSmall)
3120
+ return
3121
+
3095
3122
  def updateTheme(self) -> None:
3096
3123
  """Update theme elements."""
3097
3124
  iPx = round(0.9*SHARED.theme.baseIconHeight)
@@ -31,10 +31,7 @@ import logging
31
31
  from enum import Enum
32
32
 
33
33
  from PyQt5.QtCore import QPoint, Qt, QUrl, pyqtSignal, pyqtSlot
34
- from PyQt5.QtGui import (
35
- QCursor, QFont, QMouseEvent, QPalette, QResizeEvent, QTextCursor,
36
- QTextOption
37
- )
34
+ from PyQt5.QtGui import QCursor, QMouseEvent, QPalette, QResizeEvent, QTextCursor, QTextOption
38
35
  from PyQt5.QtWidgets import (
39
36
  QAction, QApplication, QFrame, QHBoxLayout, QLabel, QMenu, QTextBrowser,
40
37
  QToolButton, QWidget
@@ -141,12 +138,7 @@ class GuiDocViewer(QTextBrowser):
141
138
  def initViewer(self) -> None:
142
139
  """Set editor settings from main config."""
143
140
  self._makeStyleSheet()
144
-
145
- # Set Font
146
- font = QFont()
147
- font.setFamily(CONFIG.textFont)
148
- font.setPointSize(CONFIG.textSize)
149
- self.document().setDefaultFont(font)
141
+ self.initFont()
150
142
 
151
143
  # Set the widget colours to match syntax theme
152
144
  mainPalette = self.palette()
@@ -189,6 +181,22 @@ class GuiDocViewer(QTextBrowser):
189
181
 
190
182
  return
191
183
 
184
+ def initFont(self) -> None:
185
+ """Set the font of the main widget and sub-widgets. This needs
186
+ special attention since there appears to be a bug in Qt 5.15.3.
187
+ See issues #1862 and #1875.
188
+ """
189
+ font = self.font()
190
+ font.setFamily(CONFIG.textFont)
191
+ font.setPointSize(CONFIG.textSize)
192
+ self.setFont(font)
193
+
194
+ # Reset sub-widget font to GUI font
195
+ self.docHeader.updateFont()
196
+ self.docFooter.updateFont()
197
+
198
+ return
199
+
192
200
  def loadText(self, tHandle: str, updateHistory: bool = True) -> bool:
193
201
  """Load text into the viewer from an item handle."""
194
202
  if not SHARED.project.tree.checkType(tHandle, nwItemType.FILE):
@@ -646,10 +654,6 @@ class GuiDocViewHeader(QWidget):
646
654
  self.itemTitle.setAlignment(QtAlignCenterTop)
647
655
  self.itemTitle.setFixedHeight(iPx)
648
656
 
649
- lblFont = self.itemTitle.font()
650
- lblFont.setPointSizeF(0.9*SHARED.theme.fontPointSize)
651
- self.itemTitle.setFont(lblFont)
652
-
653
657
  # Other Widgets
654
658
  self.outlineMenu = QMenu(self)
655
659
 
@@ -700,7 +704,7 @@ class GuiDocViewHeader(QWidget):
700
704
  self.outerBox.setContentsMargins(mPx, mPx, mPx, mPx)
701
705
  self.setMinimumHeight(iPx + 2*mPx)
702
706
 
703
- # Fix the Colours
707
+ self.updateFont()
704
708
  self.updateTheme()
705
709
 
706
710
  logger.debug("Ready: GuiDocViewHeader")
@@ -745,6 +749,12 @@ class GuiDocViewHeader(QWidget):
745
749
  self._docOutline = data
746
750
  return
747
751
 
752
+ def updateFont(self) -> None:
753
+ """Update the font settings."""
754
+ self.setFont(SHARED.theme.guiFont)
755
+ self.itemTitle.setFont(SHARED.theme.guiFontSmall)
756
+ return
757
+
748
758
  def updateTheme(self) -> None:
749
759
  """Update theme elements."""
750
760
  self.outlineButton.setThemeIcon("list")
@@ -886,11 +896,6 @@ class GuiDocViewFooter(QWidget):
886
896
  self.showSynopsis.toggled.connect(self._doToggleSynopsis)
887
897
  self.showSynopsis.setToolTip(self.tr("Show Synopsis Comments"))
888
898
 
889
- lblFont = self.font()
890
- lblFont.setPointSizeF(0.9*SHARED.theme.fontPointSize)
891
- self.showComments.setFont(lblFont)
892
- self.showSynopsis.setFont(lblFont)
893
-
894
899
  # Assemble Layout
895
900
  self.outerBox = QHBoxLayout()
896
901
  self.outerBox.addWidget(self.showHide, 0)
@@ -906,7 +911,7 @@ class GuiDocViewFooter(QWidget):
906
911
  self.outerBox.setContentsMargins(mPx, mPx, mPx, mPx)
907
912
  self.setMinimumHeight(iPx + 2*mPx)
908
913
 
909
- # Fix the Colours
914
+ self.updateFont()
910
915
  self.updateTheme()
911
916
 
912
917
  logger.debug("Ready: GuiDocViewFooter")
@@ -917,6 +922,13 @@ class GuiDocViewFooter(QWidget):
917
922
  # Methods
918
923
  ##
919
924
 
925
+ def updateFont(self) -> None:
926
+ """Update the font settings."""
927
+ self.setFont(SHARED.theme.guiFont)
928
+ self.showComments.setFont(SHARED.theme.guiFontSmall)
929
+ self.showSynopsis.setFont(SHARED.theme.guiFontSmall)
930
+ return
931
+
920
932
  def updateTheme(self) -> None:
921
933
  """Update theme elements."""
922
934
  # Icons
novelwriter/gui/theme.py CHANGED
@@ -30,9 +30,7 @@ from math import ceil
30
30
  from pathlib import Path
31
31
 
32
32
  from PyQt5.QtCore import QSize, Qt
33
- from PyQt5.QtGui import (
34
- QPalette, QColor, QIcon, QFont, QFontMetrics, QFontDatabase, QPixmap
35
- )
33
+ from PyQt5.QtGui import QColor, QFont, QFontDatabase, QFontMetrics, QIcon, QPalette, QPixmap
36
34
  from PyQt5.QtWidgets import QApplication
37
35
 
38
36
  from novelwriter import CONFIG
@@ -154,6 +152,8 @@ class GuiTheme:
154
152
  self.guiFont = QApplication.font()
155
153
  self.guiFontB = QApplication.font()
156
154
  self.guiFontB.setBold(True)
155
+ self.guiFontSmall = QApplication.font()
156
+ self.guiFontSmall.setPointSizeF(0.9*self.guiFont.pointSizeF())
157
157
 
158
158
  qMetric = QFontMetrics(self.guiFont)
159
159
  fHeight = qMetric.height()
@@ -36,7 +36,7 @@ from PyQt5.QtWidgets import (
36
36
  )
37
37
 
38
38
  from novelwriter import CONFIG, SHARED
39
- from novelwriter.common import formatFileFilter, openExternalPath, formatInt, getFileSize
39
+ from novelwriter.common import formatFileFilter, formatInt, getFileSize, openExternalPath
40
40
  from novelwriter.error import formatException
41
41
  from novelwriter.extensions.modified import NIconToolButton
42
42
  from novelwriter.types import QtDialogClose
@@ -143,11 +143,12 @@ class GuiDictionaries(QDialog):
143
143
  try:
144
144
  import enchant
145
145
  path = Path(enchant.get_user_config_dir())
146
+ self._installPath = Path(path).resolve()
147
+ self._installPath.mkdir(exist_ok=True, parents=True)
146
148
  except Exception:
147
149
  logger.error("Could not get enchant path")
148
150
  return False
149
151
 
150
- self._installPath = Path(path).resolve()
151
152
  if path.is_dir():
152
153
  self.inPath.setText(str(path))
153
154
  hunspell = path / "hunspell"
@@ -199,9 +200,9 @@ class GuiDictionaries(QDialog):
199
200
  if self._installPath:
200
201
  temp = self.huInput.text()
201
202
  if temp and (path := Path(temp)).is_file():
202
- hunspell = self._installPath / "hunspell"
203
- hunspell.mkdir(exist_ok=True)
204
203
  try:
204
+ hunspell = self._installPath / "hunspell"
205
+ hunspell.mkdir(exist_ok=True)
205
206
  nAff, nDic = self._extractDicts(path, hunspell)
206
207
  if nAff == 0 or nDic == 0:
207
208
  self._appendLog(procErr, err=True)
@@ -31,7 +31,7 @@ from time import time
31
31
  from typing import TYPE_CHECKING
32
32
 
33
33
  from PyQt5.QtCore import Qt, QTimer, QUrl, pyqtSignal, pyqtSlot
34
- from PyQt5.QtGui import QCloseEvent, QColor, QCursor, QFont, QPalette, QResizeEvent
34
+ from PyQt5.QtGui import QCloseEvent, QColor, QCursor, QPalette, QResizeEvent
35
35
  from PyQt5.QtPrintSupport import QPrinter, QPrintPreviewDialog
36
36
  from PyQt5.QtWidgets import (
37
37
  QAbstractItemView, QApplication, QDialog, QFormLayout, QGridLayout,
@@ -761,7 +761,6 @@ class _PreviewWidget(QTextBrowser):
761
761
  self.setPalette(dPalette)
762
762
 
763
763
  self.setMinimumWidth(40*SHARED.theme.textNWidth)
764
- self.setTextFont(CONFIG.textFont, CONFIG.textSize)
765
764
  self.setTabStopDistance(CONFIG.getTabWidth())
766
765
  self.setOpenExternalLinks(False)
767
766
 
@@ -802,6 +801,8 @@ class _PreviewWidget(QTextBrowser):
802
801
  self._updateDocMargins()
803
802
  self._updateBuildAge()
804
803
 
804
+ self.setTextFont(CONFIG.textFont, CONFIG.textSize)
805
+
805
806
  # Age Timer
806
807
  self.ageTimer = QTimer(self)
807
808
  self.ageTimer.setInterval(10000)
@@ -831,12 +832,17 @@ class _PreviewWidget(QTextBrowser):
831
832
  return
832
833
 
833
834
  def setTextFont(self, family: str, size: int) -> None:
834
- """Set the text font properties."""
835
- if family:
836
- font = QFont()
835
+ """Set the text font properties and then reset for sub-widgets.
836
+ This needs special attention since there appears to be a bug in
837
+ Qt 5.15.3. See issues #1862 and #1875.
838
+ """
839
+ if family and size > 4:
840
+ font = self.font()
837
841
  font.setFamily(family)
838
842
  font.setPointSize(size)
839
- self.document().setDefaultFont(font)
843
+ self.setFont(font)
844
+ self.buildProgress.setFont(SHARED.theme.guiFont)
845
+ self.ageLabel.setFont(SHARED.theme.guiFontSmall)
840
846
  return
841
847
 
842
848
  ##