novelWriter 2.3rc1__py3-none-any.whl → 2.4b1__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.3rc1.dist-info → novelWriter-2.4b1.dist-info}/METADATA +1 -1
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/RECORD +99 -85
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/WHEEL +1 -1
- novelWriter-2.4b1.dist-info/entry_points.txt +2 -0
- novelwriter/__init__.py +5 -5
- novelwriter/assets/i18n/nw_de_DE.qm +0 -0
- novelwriter/assets/i18n/nw_en_US.qm +0 -0
- novelwriter/assets/i18n/nw_es_419.qm +0 -0
- novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
- novelwriter/assets/i18n/nw_it_IT.qm +0 -0
- novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
- novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
- novelwriter/assets/i18n/nw_nl_NL.qm +0 -0
- novelwriter/assets/i18n/project_nl_NL.json +11 -0
- novelwriter/assets/i18n/project_pt_BR.json +11 -0
- novelwriter/assets/icons/typicons_dark/icons.conf +4 -0
- novelwriter/assets/icons/typicons_dark/nw_tb-mark.svg +7 -0
- novelwriter/assets/icons/typicons_dark/typ_arrow-down.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_arrow-right.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_refresh-flipped.svg +1 -1
- novelwriter/assets/icons/typicons_dark/typ_refresh.svg +1 -1
- novelwriter/assets/icons/typicons_dark/typ_search-grey.svg +4 -0
- novelwriter/assets/icons/typicons_dark/typ_times.svg +1 -1
- novelwriter/assets/icons/typicons_light/icons.conf +4 -0
- novelwriter/assets/icons/typicons_light/nw_tb-mark.svg +7 -0
- novelwriter/assets/icons/typicons_light/typ_arrow-down.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_arrow-right.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_refresh-flipped.svg +1 -1
- novelwriter/assets/icons/typicons_light/typ_refresh.svg +1 -1
- novelwriter/assets/icons/typicons_light/typ_search-grey.svg +4 -0
- novelwriter/assets/icons/typicons_light/typ_times.svg +1 -1
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +26 -0
- novelwriter/assets/syntax/default_dark.conf +1 -0
- novelwriter/assets/syntax/default_light.conf +1 -0
- novelwriter/assets/syntax/grey_dark.conf +1 -0
- novelwriter/assets/syntax/grey_light.conf +1 -0
- novelwriter/assets/syntax/light_owl.conf +1 -0
- novelwriter/assets/syntax/night_owl.conf +1 -0
- novelwriter/assets/syntax/solarized_dark.conf +1 -0
- novelwriter/assets/syntax/solarized_light.conf +1 -0
- novelwriter/assets/syntax/tango.conf +23 -0
- novelwriter/assets/syntax/tomorrow.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_blue.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_bright.conf +1 -0
- novelwriter/assets/syntax/tomorrow_night_eighties.conf +1 -0
- novelwriter/assets/text/credits_en.htm +25 -23
- novelwriter/assets/themes/cyberpunk_night.conf +29 -0
- novelwriter/common.py +1 -1
- novelwriter/config.py +35 -12
- novelwriter/constants.py +5 -6
- novelwriter/core/buildsettings.py +60 -40
- novelwriter/core/coretools.py +98 -13
- novelwriter/core/docbuild.py +74 -7
- novelwriter/core/document.py +24 -3
- novelwriter/core/index.py +31 -112
- novelwriter/core/project.py +11 -15
- novelwriter/core/projectxml.py +2 -1
- novelwriter/core/sessions.py +2 -2
- novelwriter/core/status.py +4 -4
- novelwriter/core/storage.py +16 -6
- novelwriter/core/tohtml.py +22 -25
- novelwriter/core/tokenizer.py +416 -236
- novelwriter/core/tomd.py +17 -8
- novelwriter/core/toodt.py +65 -7
- novelwriter/core/tree.py +8 -8
- novelwriter/dialogs/about.py +2 -2
- novelwriter/dialogs/docsplit.py +7 -8
- novelwriter/dialogs/preferences.py +3 -6
- novelwriter/dialogs/wordlist.py +1 -1
- novelwriter/enum.py +17 -14
- novelwriter/extensions/configlayout.py +22 -0
- novelwriter/extensions/modified.py +20 -2
- novelwriter/extensions/versioninfo.py +1 -1
- novelwriter/gui/doceditor.py +257 -279
- novelwriter/gui/dochighlight.py +29 -25
- novelwriter/gui/docviewer.py +139 -148
- novelwriter/gui/docviewerpanel.py +4 -24
- novelwriter/gui/editordocument.py +12 -1
- novelwriter/gui/itemdetails.py +6 -6
- novelwriter/gui/mainmenu.py +37 -17
- novelwriter/gui/noveltree.py +11 -19
- novelwriter/gui/outline.py +43 -20
- novelwriter/gui/projtree.py +88 -88
- novelwriter/gui/search.py +316 -0
- novelwriter/gui/sidebar.py +25 -30
- novelwriter/gui/theme.py +68 -8
- novelwriter/guimain.py +183 -178
- novelwriter/shared.py +26 -1
- novelwriter/text/__init__.py +3 -0
- novelwriter/text/counting.py +137 -0
- novelwriter/tools/manuscript.py +344 -55
- novelwriter/tools/manussettings.py +214 -71
- novelwriter/tools/noveldetails.py +1 -1
- novelwriter/tools/welcome.py +8 -9
- novelWriter-2.3rc1.dist-info/entry_points.txt +0 -5
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.3rc1.dist-info → novelWriter-2.4b1.dist-info}/top_level.txt +0 -0
@@ -26,8 +26,9 @@ from __future__ import annotations
|
|
26
26
|
import logging
|
27
27
|
|
28
28
|
from time import time
|
29
|
+
from collections.abc import Iterable
|
29
30
|
|
30
|
-
from PyQt5.QtGui import QTextCursor, QTextDocument
|
31
|
+
from PyQt5.QtGui import QTextBlock, QTextCursor, QTextDocument
|
31
32
|
from PyQt5.QtCore import QObject, pyqtSlot
|
32
33
|
from PyQt5.QtWidgets import QPlainTextDocumentLayout, qApp
|
33
34
|
from novelwriter import SHARED
|
@@ -113,6 +114,16 @@ class GuiTextDocument(QTextDocument):
|
|
113
114
|
return word, cPos, cLen, SHARED.spelling.suggestWords(word)
|
114
115
|
return "", -1, -1, []
|
115
116
|
|
117
|
+
def iterBlockByType(self, cType: int, maxCount: int = 1000) -> Iterable[QTextBlock]:
|
118
|
+
"""Iterate over all text blocks of a given type."""
|
119
|
+
count = 0
|
120
|
+
for i in range(self.blockCount()):
|
121
|
+
block = self.findBlockByNumber(i)
|
122
|
+
if count < maxCount and block.isValid() and block.userState() & cType > 0:
|
123
|
+
count += 1
|
124
|
+
yield block
|
125
|
+
return None
|
126
|
+
|
116
127
|
##
|
117
128
|
# Public Slots
|
118
129
|
##
|
novelwriter/gui/itemdetails.py
CHANGED
@@ -48,7 +48,7 @@ class GuiItemDetails(QWidget):
|
|
48
48
|
logger.debug("Create: GuiItemDetails")
|
49
49
|
|
50
50
|
# Internal Variables
|
51
|
-
self.
|
51
|
+
self._handle = None
|
52
52
|
|
53
53
|
# Sizes
|
54
54
|
hSp = CONFIG.pxInt(6)
|
@@ -194,7 +194,7 @@ class GuiItemDetails(QWidget):
|
|
194
194
|
|
195
195
|
def clearDetails(self) -> None:
|
196
196
|
"""Clear all the data values."""
|
197
|
-
self.
|
197
|
+
self._handle = None
|
198
198
|
self.labelIcon.clear()
|
199
199
|
self.labelData.clear()
|
200
200
|
self.statusIcon.clear()
|
@@ -210,11 +210,11 @@ class GuiItemDetails(QWidget):
|
|
210
210
|
|
211
211
|
def refreshDetails(self) -> None:
|
212
212
|
"""Reload the content of the details panel."""
|
213
|
-
self.updateViewBox(self.
|
213
|
+
self.updateViewBox(self._handle)
|
214
214
|
|
215
215
|
def updateTheme(self) -> None:
|
216
216
|
"""Update theme elements."""
|
217
|
-
self.updateViewBox(self.
|
217
|
+
self.updateViewBox(self._handle)
|
218
218
|
return
|
219
219
|
|
220
220
|
##
|
@@ -233,7 +233,7 @@ class GuiItemDetails(QWidget):
|
|
233
233
|
self.clearDetails()
|
234
234
|
return
|
235
235
|
|
236
|
-
self.
|
236
|
+
self._handle = tHandle
|
237
237
|
iPx = int(round(0.8*SHARED.theme.baseIconSize))
|
238
238
|
|
239
239
|
# Label
|
@@ -295,7 +295,7 @@ class GuiItemDetails(QWidget):
|
|
295
295
|
"""Update the counts if the handle is the same as the one we're
|
296
296
|
already showing. Otherwise, do nothing.
|
297
297
|
"""
|
298
|
-
if tHandle == self.
|
298
|
+
if tHandle == self._handle:
|
299
299
|
self.cCountData.setText(f"{cC:n}")
|
300
300
|
self.wCountData.setText(f"{wC:n}")
|
301
301
|
self.pCountData.setText(f"{pC:n}")
|
novelwriter/gui/mainmenu.py
CHANGED
@@ -33,9 +33,9 @@ from PyQt5.QtCore import QUrl, pyqtSignal, pyqtSlot
|
|
33
33
|
from PyQt5.QtWidgets import QMenuBar, QAction
|
34
34
|
|
35
35
|
from novelwriter import CONFIG, SHARED
|
36
|
-
from novelwriter.enum import nwDocAction, nwDocInsert, nwWidget
|
37
36
|
from novelwriter.common import openExternalPath
|
38
37
|
from novelwriter.constants import nwConst, trConst, nwKeyWords, nwLabels, nwUnicode
|
38
|
+
from novelwriter.enum import nwDocAction, nwDocInsert, nwView, nwWidget
|
39
39
|
from novelwriter.extensions.eventfilters import StatusTipFilter
|
40
40
|
|
41
41
|
if TYPE_CHECKING: # pragma: no cover
|
@@ -55,6 +55,7 @@ class GuiMainMenu(QMenuBar):
|
|
55
55
|
requestDocInsertText = pyqtSignal(str)
|
56
56
|
requestDocKeyWordInsert = pyqtSignal(str)
|
57
57
|
requestFocusChange = pyqtSignal(nwWidget)
|
58
|
+
requestViewChange = pyqtSignal(nwView)
|
58
59
|
|
59
60
|
def __init__(self, mainGui: GuiMain) -> None:
|
60
61
|
super().__init__(parent=mainGui)
|
@@ -196,12 +197,12 @@ class GuiMainMenu(QMenuBar):
|
|
196
197
|
# Document > Open
|
197
198
|
self.aOpenDoc = self.docuMenu.addAction(self.tr("Open Document"))
|
198
199
|
self.aOpenDoc.setShortcut("Ctrl+O")
|
199
|
-
self.aOpenDoc.triggered.connect(
|
200
|
+
self.aOpenDoc.triggered.connect(self.mainGui.openSelectedItem)
|
200
201
|
|
201
202
|
# Document > Save
|
202
203
|
self.aSaveDoc = self.docuMenu.addAction(self.tr("Save Document"))
|
203
204
|
self.aSaveDoc.setShortcut("Ctrl+S")
|
204
|
-
self.aSaveDoc.triggered.connect(
|
205
|
+
self.aSaveDoc.triggered.connect(self.mainGui.saveDocument)
|
205
206
|
|
206
207
|
# Document > Close
|
207
208
|
self.aCloseDoc = self.docuMenu.addAction(self.tr("Close Document"))
|
@@ -219,7 +220,7 @@ class GuiMainMenu(QMenuBar):
|
|
219
220
|
# Document > Close Preview
|
220
221
|
self.aCloseView = self.docuMenu.addAction(self.tr("Close Document View"))
|
221
222
|
self.aCloseView.setShortcut("Ctrl+Shift+R")
|
222
|
-
self.aCloseView.triggered.connect(
|
223
|
+
self.aCloseView.triggered.connect(self.mainGui.closeDocViewer)
|
223
224
|
|
224
225
|
# Document > Separator
|
225
226
|
self.docuMenu.addSeparator()
|
@@ -230,7 +231,6 @@ class GuiMainMenu(QMenuBar):
|
|
230
231
|
|
231
232
|
# Document > Import From File
|
232
233
|
self.aImportFile = self.docuMenu.addAction(self.tr("Import Text from File"))
|
233
|
-
self.aImportFile.setShortcut("Ctrl+Shift+I")
|
234
234
|
self.aImportFile.triggered.connect(lambda: self.mainGui.importDocument())
|
235
235
|
|
236
236
|
return
|
@@ -672,6 +672,12 @@ class GuiMainMenu(QMenuBar):
|
|
672
672
|
lambda: self.requestDocAction.emit(nwDocAction.SC_ULINE)
|
673
673
|
)
|
674
674
|
|
675
|
+
# Shortcode Mark
|
676
|
+
self.aScMark = self.mShortcodes.addAction(self.tr("Highlight"))
|
677
|
+
self.aScMark.triggered.connect(
|
678
|
+
lambda: self.requestDocAction.emit(nwDocAction.SC_MARK)
|
679
|
+
)
|
680
|
+
|
675
681
|
# Shortcode Superscript
|
676
682
|
self.aScSuper = self.mShortcodes.addAction(self.tr("Superscript"))
|
677
683
|
self.aScSuper.triggered.connect(
|
@@ -687,29 +693,29 @@ class GuiMainMenu(QMenuBar):
|
|
687
693
|
# Format > Separator
|
688
694
|
self.fmtMenu.addSeparator()
|
689
695
|
|
690
|
-
# Format >
|
691
|
-
self.aFmtHead1 = self.fmtMenu.addAction(self.tr("
|
696
|
+
# Format > Heading 1 (Partition)
|
697
|
+
self.aFmtHead1 = self.fmtMenu.addAction(self.tr("Heading 1 (Partition)"))
|
692
698
|
self.aFmtHead1.setShortcut("Ctrl+1")
|
693
699
|
self.aFmtHead1.triggered.connect(
|
694
700
|
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_H1)
|
695
701
|
)
|
696
702
|
|
697
|
-
# Format >
|
698
|
-
self.aFmtHead2 = self.fmtMenu.addAction(self.tr("
|
703
|
+
# Format > Heading 2 (Chapter)
|
704
|
+
self.aFmtHead2 = self.fmtMenu.addAction(self.tr("Heading 2 (Chapter)"))
|
699
705
|
self.aFmtHead2.setShortcut("Ctrl+2")
|
700
706
|
self.aFmtHead2.triggered.connect(
|
701
707
|
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_H2)
|
702
708
|
)
|
703
709
|
|
704
|
-
# Format >
|
705
|
-
self.aFmtHead3 = self.fmtMenu.addAction(self.tr("
|
710
|
+
# Format > Heading 3 (Scene)
|
711
|
+
self.aFmtHead3 = self.fmtMenu.addAction(self.tr("Heading 3 (Scene)"))
|
706
712
|
self.aFmtHead3.setShortcut("Ctrl+3")
|
707
713
|
self.aFmtHead3.triggered.connect(
|
708
714
|
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_H3)
|
709
715
|
)
|
710
716
|
|
711
|
-
# Format >
|
712
|
-
self.aFmtHead4 = self.fmtMenu.addAction(self.tr("
|
717
|
+
# Format > Heading 4 (Section)
|
718
|
+
self.aFmtHead4 = self.fmtMenu.addAction(self.tr("Heading 4 (Section)"))
|
713
719
|
self.aFmtHead4.setShortcut("Ctrl+4")
|
714
720
|
self.aFmtHead4.triggered.connect(
|
715
721
|
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_H4)
|
@@ -730,6 +736,12 @@ class GuiMainMenu(QMenuBar):
|
|
730
736
|
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_UNN)
|
731
737
|
)
|
732
738
|
|
739
|
+
# Format > Hard Scene
|
740
|
+
self.aFmtHardSc = self.fmtMenu.addAction(self.tr("Hard Scene"))
|
741
|
+
self.aFmtHardSc.triggered.connect(
|
742
|
+
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_HSC)
|
743
|
+
)
|
744
|
+
|
733
745
|
# Format > Separator
|
734
746
|
self.fmtMenu.addSeparator()
|
735
747
|
|
@@ -798,14 +810,14 @@ class GuiMainMenu(QMenuBar):
|
|
798
810
|
# Format > Separator
|
799
811
|
self.fmtMenu.addSeparator()
|
800
812
|
|
801
|
-
# Format > Replace Single Quotes
|
802
|
-
self.aFmtReplSng = self.fmtMenu.addAction(self.tr("
|
813
|
+
# Format > Replace Straight Single Quotes
|
814
|
+
self.aFmtReplSng = self.fmtMenu.addAction(self.tr("Replace Straight Single Quotes"))
|
803
815
|
self.aFmtReplSng.triggered.connect(
|
804
816
|
lambda: self.requestDocAction.emit(nwDocAction.REPL_SNG)
|
805
817
|
)
|
806
818
|
|
807
|
-
# Format > Replace Double Quotes
|
808
|
-
self.aFmtReplDbl = self.fmtMenu.addAction(self.tr("
|
819
|
+
# Format > Replace Straight Double Quotes
|
820
|
+
self.aFmtReplDbl = self.fmtMenu.addAction(self.tr("Replace Straight Double Quotes"))
|
809
821
|
self.aFmtReplDbl.triggered.connect(
|
810
822
|
lambda: self.requestDocAction.emit(nwDocAction.REPL_DBL)
|
811
823
|
)
|
@@ -850,6 +862,14 @@ class GuiMainMenu(QMenuBar):
|
|
850
862
|
self.aReplaceNext.setShortcut("Ctrl+Shift+1")
|
851
863
|
self.aReplaceNext.triggered.connect(lambda: self.mainGui.docEditor.replaceNext())
|
852
864
|
|
865
|
+
# Search > Separator
|
866
|
+
self.srcMenu.addSeparator()
|
867
|
+
|
868
|
+
# Search > Find in Project
|
869
|
+
self.aFindProj = self.srcMenu.addAction(self.tr("Find in Project"))
|
870
|
+
self.aFindProj.setShortcut("Ctrl+Shift+F")
|
871
|
+
self.aFindProj.triggered.connect(lambda: self.requestViewChange.emit(nwView.SEARCH))
|
872
|
+
|
853
873
|
return
|
854
874
|
|
855
875
|
def _buildToolsMenu(self) -> None:
|
novelwriter/gui/noveltree.py
CHANGED
@@ -35,16 +35,18 @@ from PyQt5.QtGui import QFocusEvent, QFont, QMouseEvent, QPalette, QResizeEvent
|
|
35
35
|
from PyQt5.QtCore import QModelIndex, QPoint, Qt, QSize, pyqtSlot, pyqtSignal
|
36
36
|
from PyQt5.QtWidgets import (
|
37
37
|
QAbstractItemView, QActionGroup, QFrame, QHBoxLayout, QHeaderView,
|
38
|
-
QInputDialog, QMenu, QSizePolicy,
|
39
|
-
|
38
|
+
QInputDialog, QMenu, QSizePolicy, QToolTip, QTreeWidget, QTreeWidgetItem,
|
39
|
+
QVBoxLayout, QWidget
|
40
40
|
)
|
41
41
|
|
42
42
|
from novelwriter import CONFIG, SHARED
|
43
|
-
from novelwriter.enum import nwDocMode, nwItemClass, nwOutline
|
44
43
|
from novelwriter.common import minmax
|
45
44
|
from novelwriter.constants import nwHeaders, nwKeyWords, nwLabels, trConst
|
46
45
|
from novelwriter.core.index import IndexHeading
|
46
|
+
from novelwriter.enum import nwDocMode, nwItemClass, nwOutline
|
47
|
+
from novelwriter.extensions.modified import NIconToolButton
|
47
48
|
from novelwriter.extensions.novelselector import NovelSelector
|
49
|
+
from novelwriter.gui.theme import STYLES_MIN_TOOLBUTTON
|
48
50
|
|
49
51
|
if TYPE_CHECKING: # pragma: no cover
|
50
52
|
from novelwriter.guimain import GuiMain
|
@@ -215,15 +217,13 @@ class GuiNovelToolBar(QWidget):
|
|
215
217
|
self.novelValue.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
|
216
218
|
self.novelValue.novelSelectionChanged.connect(self.setCurrentRoot)
|
217
219
|
|
218
|
-
self.tbNovel =
|
220
|
+
self.tbNovel = NIconToolButton(self, iPx)
|
219
221
|
self.tbNovel.setToolTip(self.tr("Novel Root"))
|
220
|
-
self.tbNovel.setIconSize(QSize(iPx, iPx))
|
221
222
|
self.tbNovel.clicked.connect(self.novelValue.showPopup)
|
222
223
|
|
223
224
|
# Refresh Button
|
224
|
-
self.tbRefresh =
|
225
|
+
self.tbRefresh = NIconToolButton(self, iPx)
|
225
226
|
self.tbRefresh.setToolTip(self.tr("Refresh"))
|
226
|
-
self.tbRefresh.setIconSize(QSize(iPx, iPx))
|
227
227
|
self.tbRefresh.clicked.connect(self._refreshNovelTree)
|
228
228
|
|
229
229
|
# More Options Menu
|
@@ -241,11 +241,9 @@ class GuiNovelToolBar(QWidget):
|
|
241
241
|
self.aLastColSize = self.mLastCol.addAction(self.tr("Column Size"))
|
242
242
|
self.aLastColSize.triggered.connect(self._selectLastColumnSize)
|
243
243
|
|
244
|
-
self.tbMore =
|
244
|
+
self.tbMore = NIconToolButton(self, iPx)
|
245
245
|
self.tbMore.setToolTip(self.tr("More Options"))
|
246
|
-
self.tbMore.setIconSize(QSize(iPx, iPx))
|
247
246
|
self.tbMore.setMenu(self.mMore)
|
248
|
-
self.tbMore.setPopupMode(QToolButton.ToolButtonPopupMode.InstantPopup)
|
249
247
|
|
250
248
|
# Assemble
|
251
249
|
self.outerBox = QHBoxLayout()
|
@@ -280,16 +278,10 @@ class GuiNovelToolBar(QWidget):
|
|
280
278
|
self.setPalette(qPalette)
|
281
279
|
|
282
280
|
# StyleSheets
|
283
|
-
|
284
|
-
buttonStyle = (
|
285
|
-
"QToolButton {{padding: {0}px; border: none; background: transparent;}} "
|
286
|
-
"QToolButton:hover {{border: none; background: rgba({1},{2},{3},0.2);}}"
|
287
|
-
).format(CONFIG.pxInt(2), fadeCol.red(), fadeCol.green(), fadeCol.blue())
|
288
|
-
buttonStyleMenu = f"{buttonStyle} QToolButton::menu-indicator {{image: none;}}"
|
289
|
-
|
281
|
+
buttonStyle = SHARED.theme.getStyleSheet(STYLES_MIN_TOOLBUTTON)
|
290
282
|
self.tbNovel.setStyleSheet(buttonStyle)
|
291
283
|
self.tbRefresh.setStyleSheet(buttonStyle)
|
292
|
-
self.tbMore.setStyleSheet(
|
284
|
+
self.tbMore.setStyleSheet(buttonStyle)
|
293
285
|
|
294
286
|
self.novelValue.setStyleSheet(
|
295
287
|
"QComboBox {border-style: none; padding-left: 0;} "
|
@@ -750,7 +742,7 @@ class GuiNovelTree(QTreeWidget):
|
|
750
742
|
logger.debug("Generating meta data tooltip for '%s:%s'", tHandle, sTitle)
|
751
743
|
|
752
744
|
pIndex = SHARED.project.index
|
753
|
-
novIdx = pIndex.
|
745
|
+
novIdx = pIndex.getItemHeading(tHandle, sTitle)
|
754
746
|
refTags = pIndex.getReferences(tHandle, sTitle)
|
755
747
|
if not novIdx:
|
756
748
|
return
|
novelwriter/gui/outline.py
CHANGED
@@ -798,14 +798,20 @@ class GuiOutlineDetails(QScrollArea):
|
|
798
798
|
hSpace = int(CONFIG.pxInt(10))
|
799
799
|
vSpace = int(CONFIG.pxInt(4))
|
800
800
|
|
801
|
+
bFont = SHARED.theme.guiFontB
|
802
|
+
|
801
803
|
# Details Area
|
802
|
-
self.titleLabel = QLabel(
|
803
|
-
self.fileLabel = QLabel(
|
804
|
-
self.itemLabel = QLabel(
|
804
|
+
self.titleLabel = QLabel(self.tr("Title"))
|
805
|
+
self.fileLabel = QLabel(self.tr("Document"))
|
806
|
+
self.itemLabel = QLabel(self.tr("Status"))
|
805
807
|
self.titleValue = QLabel("")
|
806
808
|
self.fileValue = QLabel("")
|
807
809
|
self.itemValue = QLabel("")
|
808
810
|
|
811
|
+
self.titleLabel.setFont(bFont)
|
812
|
+
self.fileLabel.setFont(bFont)
|
813
|
+
self.itemLabel.setFont(bFont)
|
814
|
+
|
809
815
|
self.titleValue.setMinimumWidth(minTitle)
|
810
816
|
self.titleValue.setMaximumWidth(maxTitle)
|
811
817
|
self.fileValue.setMinimumWidth(minTitle)
|
@@ -814,13 +820,17 @@ class GuiOutlineDetails(QScrollArea):
|
|
814
820
|
self.itemValue.setMaximumWidth(maxTitle)
|
815
821
|
|
816
822
|
# Stats Area
|
817
|
-
self.cCLabel = QLabel(
|
818
|
-
self.wCLabel = QLabel(
|
819
|
-
self.pCLabel = QLabel(
|
823
|
+
self.cCLabel = QLabel(self.tr("Characters"))
|
824
|
+
self.wCLabel = QLabel(self.tr("Words"))
|
825
|
+
self.pCLabel = QLabel(self.tr("Paragraphs"))
|
820
826
|
self.cCValue = QLabel("")
|
821
827
|
self.wCValue = QLabel("")
|
822
828
|
self.pCValue = QLabel("")
|
823
829
|
|
830
|
+
self.cCLabel.setFont(bFont)
|
831
|
+
self.wCLabel.setFont(bFont)
|
832
|
+
self.pCLabel.setFont(bFont)
|
833
|
+
|
824
834
|
self.cCValue.setMinimumWidth(wCount)
|
825
835
|
self.wCValue.setMinimumWidth(wCount)
|
826
836
|
self.pCValue.setMinimumWidth(wCount)
|
@@ -829,23 +839,36 @@ class GuiOutlineDetails(QScrollArea):
|
|
829
839
|
self.pCValue.setAlignment(Qt.AlignRight)
|
830
840
|
|
831
841
|
# Synopsis
|
832
|
-
self.synopLabel = QLabel(
|
842
|
+
self.synopLabel = QLabel(self.tr("Synopsis"))
|
843
|
+
self.synopLabel.setFont(bFont)
|
844
|
+
|
833
845
|
self.synopValue = QLabel("")
|
834
|
-
self.synopLWrap = QHBoxLayout()
|
835
846
|
self.synopValue.setWordWrap(True)
|
836
847
|
self.synopValue.setAlignment(Qt.AlignTop | Qt.AlignLeft)
|
848
|
+
|
849
|
+
self.synopLWrap = QHBoxLayout()
|
837
850
|
self.synopLWrap.addWidget(self.synopValue, 1)
|
838
851
|
|
839
852
|
# Tags
|
840
|
-
self.povKeyLabel = QLabel(
|
841
|
-
self.focKeyLabel = QLabel(
|
842
|
-
self.chrKeyLabel = QLabel(
|
843
|
-
self.pltKeyLabel = QLabel(
|
844
|
-
self.timKeyLabel = QLabel(
|
845
|
-
self.wldKeyLabel = QLabel(
|
846
|
-
self.objKeyLabel = QLabel(
|
847
|
-
self.entKeyLabel = QLabel(
|
848
|
-
self.cstKeyLabel = QLabel(
|
853
|
+
self.povKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.POV_KEY]))
|
854
|
+
self.focKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.FOCUS_KEY]))
|
855
|
+
self.chrKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.CHAR_KEY]))
|
856
|
+
self.pltKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.PLOT_KEY]))
|
857
|
+
self.timKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.TIME_KEY]))
|
858
|
+
self.wldKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.WORLD_KEY]))
|
859
|
+
self.objKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.OBJECT_KEY]))
|
860
|
+
self.entKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.ENTITY_KEY]))
|
861
|
+
self.cstKeyLabel = QLabel(trConst(nwLabels.KEY_NAME[nwKeyWords.CUSTOM_KEY]))
|
862
|
+
|
863
|
+
self.povKeyLabel.setFont(bFont)
|
864
|
+
self.focKeyLabel.setFont(bFont)
|
865
|
+
self.chrKeyLabel.setFont(bFont)
|
866
|
+
self.pltKeyLabel.setFont(bFont)
|
867
|
+
self.timKeyLabel.setFont(bFont)
|
868
|
+
self.wldKeyLabel.setFont(bFont)
|
869
|
+
self.objKeyLabel.setFont(bFont)
|
870
|
+
self.entKeyLabel.setFont(bFont)
|
871
|
+
self.cstKeyLabel.setFont(bFont)
|
849
872
|
|
850
873
|
self.povKeyLWrap = QHBoxLayout()
|
851
874
|
self.focKeyLWrap = QHBoxLayout()
|
@@ -989,7 +1012,7 @@ class GuiOutlineDetails(QScrollArea):
|
|
989
1012
|
|
990
1013
|
def clearDetails(self) -> None:
|
991
1014
|
"""Clear all the data labels."""
|
992
|
-
self.titleLabel.setText(
|
1015
|
+
self.titleLabel.setText(self.tr("Title"))
|
993
1016
|
self.titleValue.setText("")
|
994
1017
|
self.fileValue.setText("")
|
995
1018
|
self.itemValue.setText("")
|
@@ -1020,10 +1043,10 @@ class GuiOutlineDetails(QScrollArea):
|
|
1020
1043
|
"""
|
1021
1044
|
pIndex = SHARED.project.index
|
1022
1045
|
nwItem = SHARED.project.tree[tHandle]
|
1023
|
-
novIdx = pIndex.
|
1046
|
+
novIdx = pIndex.getItemHeading(tHandle, sTitle)
|
1024
1047
|
novRefs = pIndex.getReferences(tHandle, sTitle)
|
1025
1048
|
if nwItem and novIdx:
|
1026
|
-
self.titleLabel.setText(
|
1049
|
+
self.titleLabel.setText(self.tr(self.LVL_MAP.get(novIdx.level, "H1")))
|
1027
1050
|
self.titleValue.setText(novIdx.title)
|
1028
1051
|
|
1029
1052
|
itemStatus, _ = nwItem.getImportStatus(incIcon=False)
|