Use the indenta decorators of the novel tree to indicate type
@@ -83,3 +83,8 @@ view_build = typ_export.svg
|
|||||||
view_editor = mixed_edit.svg
|
view_editor = mixed_edit.svg
|
||||||
view_novel = typ_book-grey.svg
|
view_novel = typ_book-grey.svg
|
||||||
view_outline = typ_puzzle-outline.svg
|
view_outline = typ_puzzle-outline.svg
|
||||||
|
|
||||||
|
deco_doc_h1 = nw_deco-h1.svg
|
||||||
|
deco_doc_h2 = nw_deco-h2.svg
|
||||||
|
deco_doc_h3 = nw_deco-h3.svg
|
||||||
|
deco_doc_h4 = nw_deco-h4.svg
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="4"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 4 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#848484;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="0"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 902 B |
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="4"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 4 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#99cc99;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="0"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 902 B |
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="20"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 20 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#d64848;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="16"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 905 B |
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="36"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 36 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#6699cc;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="32"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 905 B |
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="52"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 52 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#ffffff;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="48"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 905 B |
@@ -83,3 +83,8 @@ view_build = typ_export.svg
|
|||||||
view_editor = mixed_edit.svg
|
view_editor = mixed_edit.svg
|
||||||
view_novel = typ_book-grey.svg
|
view_novel = typ_book-grey.svg
|
||||||
view_outline = typ_puzzle-outline.svg
|
view_outline = typ_puzzle-outline.svg
|
||||||
|
|
||||||
|
deco_doc_h1 = nw_deco-h1.svg
|
||||||
|
deco_doc_h2 = nw_deco-h2.svg
|
||||||
|
deco_doc_h3 = nw_deco-h3.svg
|
||||||
|
deco_doc_h4 = nw_deco-h4.svg
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="4"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 4 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#848484;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="0"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 902 B |
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="4"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 4 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#718c00;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="0"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 902 B |
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="20"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 20 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#c82829;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="16"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 905 B |
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="36"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 36 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#4271ae;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="32"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 905 B |
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.2"
|
||||||
|
width="52"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 52 24"
|
||||||
|
id="svg2161"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<metadata
|
||||||
|
id="metadata2167">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs2165" />
|
||||||
|
<rect
|
||||||
|
style="fill:#333333;fill-opacity:1;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.2"
|
||||||
|
id="rect1955"
|
||||||
|
width="4"
|
||||||
|
height="22"
|
||||||
|
x="48"
|
||||||
|
y="1"
|
||||||
|
rx="2"
|
||||||
|
ry="2" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 905 B |
@@ -31,7 +31,7 @@ import novelwriter
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
from PyQt5.QtGui import QPalette, QPixmap, QColor
|
from PyQt5.QtGui import QPalette
|
||||||
from PyQt5.QtCore import Qt, QSize, pyqtSlot, pyqtSignal
|
from PyQt5.QtCore import Qt, QSize, pyqtSlot, pyqtSignal
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QAbstractItemView, QActionGroup, QFrame, QHBoxLayout, QHeaderView, QLabel,
|
QAbstractItemView, QActionGroup, QFrame, QHBoxLayout, QHeaderView, QLabel,
|
||||||
@@ -349,11 +349,9 @@ class GuiNovelTree(QTreeWidget):
|
|||||||
# =========
|
# =========
|
||||||
|
|
||||||
iPx = self.mainTheme.baseIconSize
|
iPx = self.mainTheme.baseIconSize
|
||||||
nPx = self.mainTheme.textNWidth
|
|
||||||
cMg = self.mainConf.pxInt(6)
|
cMg = self.mainConf.pxInt(6)
|
||||||
nMg = self.mainConf.pxInt(6)
|
|
||||||
|
|
||||||
# self.setIconSize(QSize(iPx, iPx))
|
self.setIconSize(QSize(iPx, iPx))
|
||||||
self.setFrameStyle(QFrame.NoFrame)
|
self.setFrameStyle(QFrame.NoFrame)
|
||||||
self.setHeaderHidden(True)
|
self.setHeaderHidden(True)
|
||||||
self.setIndentation(0)
|
self.setIndentation(0)
|
||||||
@@ -380,15 +378,13 @@ class GuiNovelTree(QTreeWidget):
|
|||||||
fH2.setBold(True)
|
fH2.setBold(True)
|
||||||
|
|
||||||
self._hFonts = [self.font(), fH1, fH2, self.font(), self.font()]
|
self._hFonts = [self.font(), fH1, fH2, self.font(), self.font()]
|
||||||
self._hIndent = ["", "", "", "\u203a\u00a0", "\u00bb\u00a0"]
|
self._pIndent = [
|
||||||
self._pIndent = [QPixmap(), QPixmap()]
|
self.mainTheme.loadDecoration("deco_doc_h0", pxH=iPx),
|
||||||
|
self.mainTheme.loadDecoration("deco_doc_h1", pxH=iPx),
|
||||||
hPix = QPixmap(QSize(iPx, iPx))
|
self.mainTheme.loadDecoration("deco_doc_h2", pxH=iPx),
|
||||||
hPix.fill(QColor(0, 0, 0, 0))
|
self.mainTheme.loadDecoration("deco_doc_h3", pxH=iPx),
|
||||||
for m in range(1, 4):
|
self.mainTheme.loadDecoration("deco_doc_h4", pxH=iPx),
|
||||||
self._pIndent.append(hPix.scaled(
|
]
|
||||||
max(nPx*m - nMg, nMg), 2, Qt.IgnoreAspectRatio, Qt.FastTransformation
|
|
||||||
))
|
|
||||||
|
|
||||||
# Connect signals
|
# Connect signals
|
||||||
self.itemDoubleClicked.connect(self._treeDoubleClick)
|
self.itemDoubleClicked.connect(self._treeDoubleClick)
|
||||||
@@ -571,7 +567,7 @@ class GuiNovelTree(QTreeWidget):
|
|||||||
theData = (tHandle, sTitle[1:].lstrip("0"), tKey)
|
theData = (tHandle, sTitle[1:].lstrip("0"), tKey)
|
||||||
|
|
||||||
newItem.setData(self.C_TITLE, Qt.DecorationRole, self._pIndent[iLevel])
|
newItem.setData(self.C_TITLE, Qt.DecorationRole, self._pIndent[iLevel])
|
||||||
newItem.setText(self.C_TITLE, self._hIndent[iLevel] + novIdx.title)
|
newItem.setText(self.C_TITLE, novIdx.title)
|
||||||
newItem.setData(self.C_TITLE, Qt.UserRole, theData)
|
newItem.setData(self.C_TITLE, Qt.UserRole, theData)
|
||||||
newItem.setFont(self.C_TITLE, self._hFonts[iLevel])
|
newItem.setFont(self.C_TITLE, self._hFonts[iLevel])
|
||||||
newItem.setText(self.C_WORDS, f"{novIdx.wordCount:n}")
|
newItem.setText(self.C_WORDS, f"{novIdx.wordCount:n}")
|
||||||
|
|||||||
@@ -472,9 +472,12 @@ class GuiIcons:
|
|||||||
# Switches
|
# Switches
|
||||||
"sticky-on", "sticky-off",
|
"sticky-on", "sticky-off",
|
||||||
"bullet-on", "bullet-off",
|
"bullet-on", "bullet-off",
|
||||||
|
|
||||||
|
# Decorations
|
||||||
|
"deco_doc_h0", "deco_doc_h1", "deco_doc_h2", "deco_doc_h3", "deco_doc_h4",
|
||||||
}
|
}
|
||||||
|
|
||||||
DECO_MAP = {
|
IMAGE_MAP = {
|
||||||
"wiz-back": "wizard-back.jpg",
|
"wiz-back": "wizard-back.jpg",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -573,19 +576,22 @@ class GuiIcons:
|
|||||||
# Access Functions
|
# Access Functions
|
||||||
##
|
##
|
||||||
|
|
||||||
def loadDecoration(self, decoKey, pxW, pxH):
|
def loadDecoration(self, decoKey, pxW=None, pxH=None):
|
||||||
"""Load graphical decoration element based on the decoration
|
"""Load graphical decoration element based on the decoration
|
||||||
map. This function always returns a QSwgWidget.
|
map or the icon map. This function always returns a QPixmap.
|
||||||
"""
|
"""
|
||||||
if decoKey not in self.DECO_MAP:
|
if decoKey in self._themeMap:
|
||||||
|
imgPath = self._themeMap[decoKey]
|
||||||
|
elif decoKey in self.IMAGE_MAP:
|
||||||
|
imgPath = os.path.join(
|
||||||
|
self.mainConf.assetPath, "images", self.IMAGE_MAP[decoKey]
|
||||||
|
)
|
||||||
|
else:
|
||||||
logger.error("Decoration with name '%s' does not exist", decoKey)
|
logger.error("Decoration with name '%s' does not exist", decoKey)
|
||||||
return QPixmap()
|
return QPixmap()
|
||||||
|
|
||||||
imgPath = os.path.join(
|
|
||||||
self.mainConf.assetPath, "images", self.DECO_MAP[decoKey]
|
|
||||||
)
|
|
||||||
if not os.path.isfile(imgPath):
|
if not os.path.isfile(imgPath):
|
||||||
logger.error("Decoration file '%s' not in assets folder", self.DECO_MAP[decoKey])
|
logger.error("Asset '%s' not found", self.IMAGE_MAP[decoKey])
|
||||||
return QPixmap()
|
return QPixmap()
|
||||||
|
|
||||||
theDeco = QPixmap(imgPath)
|
theDeco = QPixmap(imgPath)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<novelWriterXML appVersion="1.7-beta1" hexVersion="0x010700b1" fileVersion="1.4" timeStamp="2022-06-12 17:37:35">
|
<novelWriterXML appVersion="1.7-beta1" hexVersion="0x010700b1" fileVersion="1.4" timeStamp="2022-06-15 13:07:17">
|
||||||
<project>
|
<project>
|
||||||
<name>Sample Project</name>
|
<name>Sample Project</name>
|
||||||
<title>Sample Project</title>
|
<title>Sample Project</title>
|
||||||
<author>Jane Smith</author>
|
<author>Jane Smith</author>
|
||||||
<author>Jay Doh</author>
|
<author>Jay Doh</author>
|
||||||
<saveCount>1367</saveCount>
|
<saveCount>1371</saveCount>
|
||||||
<autoCount>231</autoCount>
|
<autoCount>236</autoCount>
|
||||||
<editTime>68784</editTime>
|
<editTime>69222</editTime>
|
||||||
</project>
|
</project>
|
||||||
<settings>
|
<settings>
|
||||||
<doBackup>False</doBackup>
|
<doBackup>False</doBackup>
|
||||||
@@ -35,9 +35,9 @@
|
|||||||
<section></section>
|
<section></section>
|
||||||
</titleFormat>
|
</titleFormat>
|
||||||
<status>
|
<status>
|
||||||
<entry key="sf12341" count="5" red="100" green="100" blue="100">New</entry>
|
<entry key="sf12341" count="4" red="100" green="100" blue="100">New</entry>
|
||||||
<entry key="sf24ce6" count="2" red="200" green="50" blue="0">Notes</entry>
|
<entry key="sf24ce6" count="2" red="200" green="50" blue="0">Notes</entry>
|
||||||
<entry key="sc24b8f" count="2" red="182" green="60" blue="0">Started</entry>
|
<entry key="sc24b8f" count="3" red="182" green="60" blue="0">Started</entry>
|
||||||
<entry key="s90e6c9" count="7" red="193" green="129" blue="0">1st Draft</entry>
|
<entry key="s90e6c9" count="7" red="193" green="129" blue="0">1st Draft</entry>
|
||||||
<entry key="sd51c5b" count="0" red="193" green="129" blue="0">2nd Draft</entry>
|
<entry key="sd51c5b" count="0" red="193" green="129" blue="0">2nd Draft</entry>
|
||||||
<entry key="s8ae72a" count="0" red="193" green="129" blue="0">3rd Draft</entry>
|
<entry key="s8ae72a" count="0" red="193" green="129" blue="0">3rd Draft</entry>
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
<name status="s90e6c9" import="ia857f0" exported="True">Chapter Two</name>
|
<name status="s90e6c9" import="ia857f0" exported="True">Chapter Two</name>
|
||||||
</item>
|
</item>
|
||||||
<item handle="ae7339df26ded" parent="88706ddc78b1b" root="7031beac91f75" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
<item handle="ae7339df26ded" parent="88706ddc78b1b" root="7031beac91f75" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||||
<meta expanded="False" charCount="189" wordCount="37" paraCount="1" cursorPos="224"/>
|
<meta expanded="False" charCount="189" wordCount="37" paraCount="1" cursorPos="0"/>
|
||||||
<name status="s90e6c9" import="ia857f0" exported="True">We Found John!</name>
|
<name status="s90e6c9" import="ia857f0" exported="True">We Found John!</name>
|
||||||
</item>
|
</item>
|
||||||
<item handle="e5e47ebf63b1c" parent="None" root="e5e47ebf63b1c" order="1" type="ROOT" class="NOVEL">
|
<item handle="e5e47ebf63b1c" parent="None" root="e5e47ebf63b1c" order="1" type="ROOT" class="NOVEL">
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item handle="bacb7059e3083" parent="e5e47ebf63b1c" root="e5e47ebf63b1c" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
<item handle="bacb7059e3083" parent="e5e47ebf63b1c" root="e5e47ebf63b1c" order="0" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||||
<meta expanded="False" charCount="27" wordCount="5" paraCount="1" cursorPos="100"/>
|
<meta expanded="False" charCount="27" wordCount="5" paraCount="1" cursorPos="100"/>
|
||||||
<name status="sf12341" import="ia857f0" exported="True">Title Page</name>
|
<name status="sc24b8f" import="ia857f0" exported="True">Title Page</name>
|
||||||
</item>
|
</item>
|
||||||
<item handle="a520879ca0b45" parent="e5e47ebf63b1c" root="e5e47ebf63b1c" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
<item handle="a520879ca0b45" parent="e5e47ebf63b1c" root="e5e47ebf63b1c" order="1" type="FILE" class="NOVEL" layout="DOCUMENT">
|
||||||
<meta expanded="False" charCount="299" wordCount="55" paraCount="2" cursorPos="104"/>
|
<meta expanded="False" charCount="299" wordCount="55" paraCount="2" cursorPos="104"/>
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ def testGuiTheme_Main(qtbot, monkeypatch, nwMinimal, tmpDir):
|
|||||||
assert anImg.isNull()
|
assert anImg.isNull()
|
||||||
|
|
||||||
# Add a non-existent file and request it
|
# Add a non-existent file and request it
|
||||||
iconCache.DECO_MAP["nonsense"] = "nofile.jpg"
|
iconCache.IMAGE_MAP["nonsense"] = "nofile.jpg"
|
||||||
anImg = iconCache.loadDecoration("nonsense", 20, 20)
|
anImg = iconCache.loadDecoration("nonsense", 20, 20)
|
||||||
assert isinstance(anImg, QPixmap)
|
assert isinstance(anImg, QPixmap)
|
||||||
assert anImg.isNull()
|
assert anImg.isNull()
|
||||||
|
|||||||