From 845a15229de2aa8ddb28ce4a484d5389f13e3304 Mon Sep 17 00:00:00 2001
From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com>
Date: Fri, 14 Oct 2022 09:37:50 +0200
Subject: [PATCH 1/4] Remove unused icons
---
.../assets/icons/typicons_dark/icons.conf | 5 ---
.../icons/typicons_dark/typ_backspace.svg | 31 ---------------
.../icons/typicons_dark/typ_bookmark.svg | 31 ---------------
.../icons/typicons_dark/typ_download.svg | 35 -----------------
.../assets/icons/typicons_dark/typ_globe.svg | 31 ---------------
.../assets/icons/typicons_dark/typ_hash.svg | 31 ---------------
.../icons/typicons_dark/typ_input-checked.svg | 35 -----------------
.../typicons_dark/typ_mod_search-replace.svg | 39 -------------------
.../icons/typicons_dark/typ_stopwatch.svg | 36 -----------------
.../assets/icons/typicons_light/icons.conf | 5 ---
.../icons/typicons_light/typ_backspace.svg | 31 ---------------
.../icons/typicons_light/typ_bookmark.svg | 31 ---------------
.../icons/typicons_light/typ_download.svg | 35 -----------------
.../assets/icons/typicons_light/typ_globe.svg | 31 ---------------
.../assets/icons/typicons_light/typ_hash.svg | 31 ---------------
.../typicons_light/typ_input-checked.svg | 35 -----------------
.../icons/typicons_light/typ_stopwatch.svg | 36 -----------------
novelwriter/gui/theme.py | 6 +--
18 files changed, 3 insertions(+), 512 deletions(-)
delete mode 100644 novelwriter/assets/icons/typicons_dark/typ_backspace.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/typ_bookmark.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/typ_download.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/typ_globe.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/typ_hash.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/typ_input-checked.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/typ_mod_search-replace.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/typ_stopwatch.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/typ_backspace.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/typ_bookmark.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/typ_download.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/typ_globe.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/typ_hash.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/typ_input-checked.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/typ_stopwatch.svg
diff --git a/novelwriter/assets/icons/typicons_dark/icons.conf b/novelwriter/assets/icons/typicons_dark/icons.conf
index 568c5b24..8a956979 100644
--- a/novelwriter/assets/icons/typicons_dark/icons.conf
+++ b/novelwriter/assets/icons/typicons_dark/icons.conf
@@ -21,7 +21,6 @@ backward = typ_chevron-left.svg
bullet-off = typ_media-record-outline.svg
bullet-on = typ_media-record.svg
check = typ_tick.svg
-clear = typ_backspace.svg
close = typ_times.svg
cls_archive = typ_delete.svg
cls_character = typ_user.svg
@@ -35,17 +34,14 @@ cls_timeline = typ_calendar.svg
cls_trash = typ_trash.svg
cls_world = typ_location.svg
cross = typ_times.svg
-delete = typ_delete.svg
doc_h0 = mixed_heading0.svg
doc_h1 = mixed_heading1.svg
doc_h2 = mixed_heading2.svg
doc_h3 = mixed_heading3.svg
doc_h4 = mixed_heading4.svg
-done = typ_input-checked.svg
down = typ_chevron-down.svg
edit = typ_pencil.svg
forward = typ_chevron-right.svg
-hash = typ_hash.svg
maximise = typ_arrow-maximise.svg
menu = typ_th-menu.svg
minimise = typ_arrow-minimise.svg
@@ -60,7 +56,6 @@ proj_title = mixed_document-title.svg
reference = typ_at.svg
refresh = typ_refresh.svg
remove = typ_minus.svg
-save = typ_download.svg
search = typ_search.svg
search_cancel = typ_cancel-grey.svg
search_case = nw_search-case.svg
diff --git a/novelwriter/assets/icons/typicons_dark/typ_backspace.svg b/novelwriter/assets/icons/typicons_dark/typ_backspace.svg
deleted file mode 100644
index f0f8ac94..00000000
--- a/novelwriter/assets/icons/typicons_dark/typ_backspace.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/typ_bookmark.svg b/novelwriter/assets/icons/typicons_dark/typ_bookmark.svg
deleted file mode 100644
index e56ebbee..00000000
--- a/novelwriter/assets/icons/typicons_dark/typ_bookmark.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/typ_download.svg b/novelwriter/assets/icons/typicons_dark/typ_download.svg
deleted file mode 100644
index e53e6fca..00000000
--- a/novelwriter/assets/icons/typicons_dark/typ_download.svg
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/typ_globe.svg b/novelwriter/assets/icons/typicons_dark/typ_globe.svg
deleted file mode 100644
index aef68b3b..00000000
--- a/novelwriter/assets/icons/typicons_dark/typ_globe.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/typ_hash.svg b/novelwriter/assets/icons/typicons_dark/typ_hash.svg
deleted file mode 100644
index 2b7419ec..00000000
--- a/novelwriter/assets/icons/typicons_dark/typ_hash.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/typ_input-checked.svg b/novelwriter/assets/icons/typicons_dark/typ_input-checked.svg
deleted file mode 100644
index 0ef2facc..00000000
--- a/novelwriter/assets/icons/typicons_dark/typ_input-checked.svg
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/typ_mod_search-replace.svg b/novelwriter/assets/icons/typicons_dark/typ_mod_search-replace.svg
deleted file mode 100644
index 588174a5..00000000
--- a/novelwriter/assets/icons/typicons_dark/typ_mod_search-replace.svg
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/typ_stopwatch.svg b/novelwriter/assets/icons/typicons_dark/typ_stopwatch.svg
deleted file mode 100644
index 345a74d0..00000000
--- a/novelwriter/assets/icons/typicons_dark/typ_stopwatch.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/icons.conf b/novelwriter/assets/icons/typicons_light/icons.conf
index 1d6a6c0c..f83315d2 100644
--- a/novelwriter/assets/icons/typicons_light/icons.conf
+++ b/novelwriter/assets/icons/typicons_light/icons.conf
@@ -21,7 +21,6 @@ backward = typ_chevron-left.svg
bullet-off = typ_media-record-outline.svg
bullet-on = typ_media-record.svg
check = typ_tick.svg
-clear = typ_backspace.svg
close = typ_times.svg
cls_archive = typ_delete.svg
cls_character = typ_user.svg
@@ -35,17 +34,14 @@ cls_timeline = typ_calendar.svg
cls_trash = typ_trash.svg
cls_world = typ_location.svg
cross = typ_times.svg
-delete = typ_delete.svg
doc_h0 = mixed_heading0.svg
doc_h1 = mixed_heading1.svg
doc_h2 = mixed_heading2.svg
doc_h3 = mixed_heading3.svg
doc_h4 = mixed_heading4.svg
-done = typ_input-checked.svg
down = typ_chevron-down.svg
edit = typ_pencil.svg
forward = typ_chevron-right.svg
-hash = typ_hash.svg
maximise = typ_arrow-maximise.svg
menu = typ_th-menu.svg
minimise = typ_arrow-minimise.svg
@@ -60,7 +56,6 @@ proj_title = mixed_document-title.svg
reference = typ_at.svg
refresh = typ_refresh.svg
remove = typ_minus.svg
-save = typ_download.svg
search = typ_search.svg
search_cancel = typ_cancel-grey.svg
search_case = nw_search-case.svg
diff --git a/novelwriter/assets/icons/typicons_light/typ_backspace.svg b/novelwriter/assets/icons/typicons_light/typ_backspace.svg
deleted file mode 100644
index 167dba0f..00000000
--- a/novelwriter/assets/icons/typicons_light/typ_backspace.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/typ_bookmark.svg b/novelwriter/assets/icons/typicons_light/typ_bookmark.svg
deleted file mode 100644
index 3936ba30..00000000
--- a/novelwriter/assets/icons/typicons_light/typ_bookmark.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/typ_download.svg b/novelwriter/assets/icons/typicons_light/typ_download.svg
deleted file mode 100644
index eb84cf04..00000000
--- a/novelwriter/assets/icons/typicons_light/typ_download.svg
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/typ_globe.svg b/novelwriter/assets/icons/typicons_light/typ_globe.svg
deleted file mode 100644
index c6f46eb4..00000000
--- a/novelwriter/assets/icons/typicons_light/typ_globe.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/typ_hash.svg b/novelwriter/assets/icons/typicons_light/typ_hash.svg
deleted file mode 100644
index ced3c240..00000000
--- a/novelwriter/assets/icons/typicons_light/typ_hash.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/typ_input-checked.svg b/novelwriter/assets/icons/typicons_light/typ_input-checked.svg
deleted file mode 100644
index 6a2124fe..00000000
--- a/novelwriter/assets/icons/typicons_light/typ_input-checked.svg
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/typ_stopwatch.svg b/novelwriter/assets/icons/typicons_light/typ_stopwatch.svg
deleted file mode 100644
index 669d84e9..00000000
--- a/novelwriter/assets/icons/typicons_light/typ_stopwatch.svg
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
diff --git a/novelwriter/gui/theme.py b/novelwriter/gui/theme.py
index e72a8c97..8324270b 100644
--- a/novelwriter/gui/theme.py
+++ b/novelwriter/gui/theme.py
@@ -465,9 +465,9 @@ class GuiIcons:
"status_stats", "status_time", "view_build", "view_editor", "view_novel", "view_outline",
# General Button Icons
- "add", "backward", "check", "clear", "close", "cross", "delete", "done", "down", "edit",
- "forward", "hash", "maximise", "menu", "minimise", "reference", "refresh", "remove",
- "save", "search_replace", "search", "settings", "up",
+ "add", "backward", "check", "close", "cross", "down", "edit", "forward", "maximise",
+ "menu", "minimise", "reference", "refresh", "remove", "search_replace", "search",
+ "settings", "up",
# Switches
"sticky-on", "sticky-off",
From 234a527f256d935cbfde3769ee4dab5ed8cf1dd8 Mon Sep 17 00:00:00 2001
From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com>
Date: Fri, 14 Oct 2022 09:40:34 +0200
Subject: [PATCH 2/4] Add icon for Novel Section documents
---
.../assets/icons/typicons_dark/icons.conf | 1 +
.../typicons_dark/mixed_document-section.svg | 47 +++++++++++++++++++
.../assets/icons/typicons_light/icons.conf | 1 +
.../typicons_light/mixed_document-section.svg | 47 +++++++++++++++++++
novelwriter/constants.py | 1 +
novelwriter/core/item.py | 2 +
novelwriter/gui/theme.py | 11 +++--
tests/test_core/test_core_item.py | 3 +-
8 files changed, 108 insertions(+), 5 deletions(-)
create mode 100644 novelwriter/assets/icons/typicons_dark/mixed_document-section.svg
create mode 100644 novelwriter/assets/icons/typicons_light/mixed_document-section.svg
diff --git a/novelwriter/assets/icons/typicons_dark/icons.conf b/novelwriter/assets/icons/typicons_dark/icons.conf
index 8a956979..46da8b3e 100644
--- a/novelwriter/assets/icons/typicons_dark/icons.conf
+++ b/novelwriter/assets/icons/typicons_dark/icons.conf
@@ -50,6 +50,7 @@ proj_details = typ_th-list-grey.svg
proj_document = typ_document-text.svg
proj_folder = typ_folder.svg
proj_note = mixed_document-note.svg
+proj_section = mixed_document-section.svg
proj_scene = mixed_document-scene.svg
proj_stats = typ_chart-bar-grey.svg
proj_title = mixed_document-title.svg
diff --git a/novelwriter/assets/icons/typicons_dark/mixed_document-section.svg b/novelwriter/assets/icons/typicons_dark/mixed_document-section.svg
new file mode 100644
index 00000000..69542bd9
--- /dev/null
+++ b/novelwriter/assets/icons/typicons_dark/mixed_document-section.svg
@@ -0,0 +1,47 @@
+
+
diff --git a/novelwriter/assets/icons/typicons_light/icons.conf b/novelwriter/assets/icons/typicons_light/icons.conf
index f83315d2..7649328c 100644
--- a/novelwriter/assets/icons/typicons_light/icons.conf
+++ b/novelwriter/assets/icons/typicons_light/icons.conf
@@ -50,6 +50,7 @@ proj_details = typ_th-list-grey.svg
proj_document = typ_document-text.svg
proj_folder = typ_folder.svg
proj_note = mixed_document-note.svg
+proj_section = mixed_document-section.svg
proj_scene = mixed_document-scene.svg
proj_stats = typ_chart-bar-grey.svg
proj_title = mixed_document-title.svg
diff --git a/novelwriter/assets/icons/typicons_light/mixed_document-section.svg b/novelwriter/assets/icons/typicons_light/mixed_document-section.svg
new file mode 100644
index 00000000..28dc015a
--- /dev/null
+++ b/novelwriter/assets/icons/typicons_light/mixed_document-section.svg
@@ -0,0 +1,47 @@
+
+
diff --git a/novelwriter/constants.py b/novelwriter/constants.py
index 3d1b5c13..2cd5b15c 100644
--- a/novelwriter/constants.py
+++ b/novelwriter/constants.py
@@ -157,6 +157,7 @@ class nwLabels:
"doc_h1": QT_TRANSLATE_NOOP("Constant", "Novel Title Page"),
"doc_h2": QT_TRANSLATE_NOOP("Constant", "Novel Chapter"),
"doc_h3": QT_TRANSLATE_NOOP("Constant", "Novel Scene"),
+ "doc_h4": QT_TRANSLATE_NOOP("Constant", "Novel Section"),
"note": QT_TRANSLATE_NOOP("Constant", "Project Note"),
}
KEY_NAME = {
diff --git a/novelwriter/core/item.py b/novelwriter/core/item.py
index a8faea8b..9901f39e 100644
--- a/novelwriter/core/item.py
+++ b/novelwriter/core/item.py
@@ -285,6 +285,8 @@ class NWItem:
descKey = "doc_h2"
elif hLevel == "H3":
descKey = "doc_h3"
+ elif hLevel == "H4":
+ descKey = "doc_h4"
else:
descKey = "document"
elif self._layout == nwItemLayout.NOTE:
diff --git a/novelwriter/gui/theme.py b/novelwriter/gui/theme.py
index 8324270b..f2d0b066 100644
--- a/novelwriter/gui/theme.py
+++ b/novelwriter/gui/theme.py
@@ -459,10 +459,11 @@ class GuiIcons:
"novelwriter", "cls_archive", "cls_character", "cls_custom", "cls_entity", "cls_none",
"cls_novel", "cls_object", "cls_plot", "cls_timeline", "cls_trash", "cls_world", "doc_h0",
"doc_h1", "doc_h2", "doc_h3", "doc_h4", "proj_chapter", "proj_details", "proj_document",
- "proj_folder", "proj_note", "proj_nwx", "proj_scene", "proj_stats", "proj_title",
- "search_cancel", "search_case", "search_loop", "search_preserve", "search_project",
- "search_regex", "search_word", "status_idle", "status_lang", "status_lines",
- "status_stats", "status_time", "view_build", "view_editor", "view_novel", "view_outline",
+ "proj_folder", "proj_note", "proj_nwx", "proj_section", "proj_scene", "proj_stats",
+ "proj_title", "search_cancel", "search_case", "search_loop", "search_preserve",
+ "search_project", "search_regex", "search_word", "status_idle", "status_lang",
+ "status_lines", "status_stats", "status_time", "view_build", "view_editor", "view_novel",
+ "view_outline",
# General Button Icons
"add", "backward", "check", "close", "cross", "down", "edit", "forward", "maximise",
@@ -641,6 +642,8 @@ class GuiIcons:
iconName = "proj_chapter"
elif hLevel == "H3":
iconName = "proj_scene"
+ elif hLevel == "H4":
+ iconName = "proj_section"
elif tLayout == nwItemLayout.NOTE:
iconName = "proj_note"
if iconName is None:
diff --git a/tests/test_core/test_core_item.py b/tests/test_core/test_core_item.py
index e2fa75e0..3f4fe7ca 100644
--- a/tests/test_core/test_core_item.py
+++ b/tests/test_core/test_core_item.py
@@ -218,7 +218,8 @@ def testCoreItem_Methods(mockGUI):
assert theItem.describeMe("H1") == "Novel Title Page"
assert theItem.describeMe("H2") == "Novel Chapter"
assert theItem.describeMe("H3") == "Novel Scene"
- assert theItem.describeMe("H4") == "Novel Document"
+ assert theItem.describeMe("H4") == "Novel Section"
+ assert theItem.describeMe("H5") == "Novel Document"
theItem.setLayout("NOTE")
assert theItem.isNoteLayout() is True
From 91e6b0671e637ac4f5aef701983942decfaf38e2 Mon Sep 17 00:00:00 2001
From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com>
Date: Fri, 14 Oct 2022 10:19:31 +0200
Subject: [PATCH 3/4] Add header decoration function to the icon class
---
novelwriter/gui/noveltree.py | 11 +++--------
novelwriter/gui/outline.py | 10 ++--------
novelwriter/gui/theme.py | 31 +++++++++++++++++++++++--------
3 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/novelwriter/gui/noveltree.py b/novelwriter/gui/noveltree.py
index b68fb812..80e3b66e 100644
--- a/novelwriter/gui/noveltree.py
+++ b/novelwriter/gui/noveltree.py
@@ -390,13 +390,6 @@ class GuiNovelTree(QTreeWidget):
fH2.setBold(True)
self._hFonts = [self.font(), fH1, fH2, self.font(), self.font()]
- self._pIndent = [
- self.mainTheme.loadDecoration("deco_doc_h0", pxH=iPx),
- self.mainTheme.loadDecoration("deco_doc_h1", pxH=iPx),
- self.mainTheme.loadDecoration("deco_doc_h2", pxH=iPx),
- self.mainTheme.loadDecoration("deco_doc_h3", pxH=iPx),
- self.mainTheme.loadDecoration("deco_doc_h4", pxH=iPx),
- ]
self._pMore = self.mainTheme.loadDecoration("deco_doc_more", pxH=iPx)
# Connect signals
@@ -619,8 +612,10 @@ class GuiNovelTree(QTreeWidget):
if iLevel == 0:
continue
+ hDec = self.mainTheme.getHeaderDecoration(iLevel)
+
newItem = QTreeWidgetItem()
- newItem.setData(self.C_TITLE, Qt.DecorationRole, self._pIndent[iLevel])
+ newItem.setData(self.C_TITLE, Qt.DecorationRole, hDec)
newItem.setText(self.C_TITLE, novIdx.title)
newItem.setData(self.C_TITLE, self.D_HANDLE, tHandle)
newItem.setData(self.C_TITLE, self.D_TITLE, sTitle)
diff --git a/novelwriter/gui/outline.py b/novelwriter/gui/outline.py
index ea76676f..d0837360 100644
--- a/novelwriter/gui/outline.py
+++ b/novelwriter/gui/outline.py
@@ -391,13 +391,6 @@ class GuiOutlineTree(QTreeWidget):
fH2.setBold(True)
self._hFonts = [self.font(), fH1, fH2, self.font(), self.font()]
- self._pIndent = [
- self.mainTheme.loadDecoration("deco_doc_h0", pxH=iPx),
- self.mainTheme.loadDecoration("deco_doc_h1", pxH=iPx),
- self.mainTheme.loadDecoration("deco_doc_h2", pxH=iPx),
- self.mainTheme.loadDecoration("deco_doc_h3", pxH=iPx),
- self.mainTheme.loadDecoration("deco_doc_h4", pxH=iPx),
- ]
self._dIcon = {
"H0": self.mainTheme.getItemIcon(nwItemType.FILE, None, nwItemLayout.DOCUMENT, "H0"),
"H1": self.mainTheme.getItemIcon(nwItemType.FILE, None, nwItemLayout.DOCUMENT, "H1"),
@@ -698,8 +691,9 @@ class GuiOutlineTree(QTreeWidget):
trItem = QTreeWidgetItem()
nwItem = self.theProject.tree[tHandle]
+ hDec = self.mainTheme.getHeaderDecoration(iLevel)
- trItem.setData(self._colIdx[nwOutline.TITLE], Qt.DecorationRole, self._pIndent[iLevel])
+ trItem.setData(self._colIdx[nwOutline.TITLE], Qt.DecorationRole, hDec)
trItem.setText(self._colIdx[nwOutline.TITLE], novIdx.title)
trItem.setData(self._colIdx[nwOutline.TITLE], self.D_HANDLE, tHandle)
trItem.setData(self._colIdx[nwOutline.TITLE], self.D_TITLE, sTitle)
diff --git a/novelwriter/gui/theme.py b/novelwriter/gui/theme.py
index f2d0b066..7227ed11 100644
--- a/novelwriter/gui/theme.py
+++ b/novelwriter/gui/theme.py
@@ -38,7 +38,7 @@ from PyQt5.QtGui import (
from novelwriter.enum import nwItemLayout, nwItemType
from novelwriter.error import logException
-from novelwriter.common import NWConfigParser, readTextFile
+from novelwriter.common import NWConfigParser, minmax, readTextFile
from novelwriter.constants import nwLabels
logger = logging.getLogger(__name__)
@@ -134,6 +134,7 @@ class GuiTheme:
self.getPixmap = self.iconCache.getPixmap
self.getItemIcon = self.iconCache.getItemIcon
self.loadDecoration = self.iconCache.loadDecoration
+ self.getHeaderDecoration = self.iconCache.getHeaderDecoration
# Extract Other Info
self.guiDPI = qApp.primaryScreen().logicalDotsPerInchX()
@@ -457,13 +458,12 @@ class GuiIcons:
ICON_KEYS = {
# Project and GUI icons
"novelwriter", "cls_archive", "cls_character", "cls_custom", "cls_entity", "cls_none",
- "cls_novel", "cls_object", "cls_plot", "cls_timeline", "cls_trash", "cls_world", "doc_h0",
- "doc_h1", "doc_h2", "doc_h3", "doc_h4", "proj_chapter", "proj_details", "proj_document",
- "proj_folder", "proj_note", "proj_nwx", "proj_section", "proj_scene", "proj_stats",
- "proj_title", "search_cancel", "search_case", "search_loop", "search_preserve",
- "search_project", "search_regex", "search_word", "status_idle", "status_lang",
- "status_lines", "status_stats", "status_time", "view_build", "view_editor", "view_novel",
- "view_outline",
+ "cls_novel", "cls_object", "cls_plot", "cls_timeline", "cls_trash", "cls_world",
+ "proj_chapter", "proj_details", "proj_document", "proj_folder", "proj_note", "proj_nwx",
+ "proj_section", "proj_scene", "proj_stats", "proj_title", "search_cancel", "search_case",
+ "search_loop", "search_preserve", "search_project", "search_regex", "search_word",
+ "status_idle", "status_lang", "status_lines", "status_stats", "status_time", "view_build",
+ "view_editor", "view_novel", "view_outline",
# General Button Icons
"add", "backward", "check", "close", "cross", "down", "edit", "forward", "maximise",
@@ -491,6 +491,7 @@ class GuiIcons:
self._qIcons = {}
self._themeMap = {}
self._themeList = []
+ self._headerDec = []
self._confName = "icons.conf"
# Icon Theme Path
@@ -651,6 +652,20 @@ class GuiIcons:
return self.getIcon(iconName)
+ def getHeaderDecoration(self, hLevel):
+ """Get the decoration for a specific header level.
+ """
+ if not self._headerDec:
+ iPx = self.mainTheme.baseIconSize
+ self._headerDec = [
+ self.loadDecoration("deco_doc_h0", pxH=iPx),
+ self.loadDecoration("deco_doc_h1", pxH=iPx),
+ self.loadDecoration("deco_doc_h2", pxH=iPx),
+ self.loadDecoration("deco_doc_h3", pxH=iPx),
+ self.loadDecoration("deco_doc_h4", pxH=iPx),
+ ]
+ return self._headerDec[minmax(hLevel, 0, 4)]
+
def listThemes(self):
"""Scan the icons themes folder and list all themes.
"""
From 07a5def0a916c5eb276c68d153782042d4691e51 Mon Sep 17 00:00:00 2001
From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com>
Date: Fri, 14 Oct 2022 10:20:30 +0200
Subject: [PATCH 4/4] Change project details to use decoration graphics rather
than icons, and delete the no longer used header icons
---
.../assets/icons/typicons_dark/icons.conf | 5 --
.../icons/typicons_dark/mixed_heading0.svg | 31 ----------
.../icons/typicons_dark/mixed_heading1.svg | 37 ------------
.../icons/typicons_dark/mixed_heading2.svg | 43 --------------
.../icons/typicons_dark/mixed_heading3.svg | 49 ---------------
.../icons/typicons_dark/mixed_heading4.svg | 59 -------------------
.../assets/icons/typicons_light/icons.conf | 5 --
.../icons/typicons_light/mixed_heading0.svg | 31 ----------
.../icons/typicons_light/mixed_heading1.svg | 37 ------------
.../icons/typicons_light/mixed_heading2.svg | 43 --------------
.../icons/typicons_light/mixed_heading3.svg | 49 ---------------
.../icons/typicons_light/mixed_heading4.svg | 55 -----------------
novelwriter/dialogs/projdetails.py | 3 +-
13 files changed, 2 insertions(+), 445 deletions(-)
delete mode 100644 novelwriter/assets/icons/typicons_dark/mixed_heading0.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/mixed_heading1.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/mixed_heading2.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/mixed_heading3.svg
delete mode 100644 novelwriter/assets/icons/typicons_dark/mixed_heading4.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/mixed_heading0.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/mixed_heading1.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/mixed_heading2.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/mixed_heading3.svg
delete mode 100644 novelwriter/assets/icons/typicons_light/mixed_heading4.svg
diff --git a/novelwriter/assets/icons/typicons_dark/icons.conf b/novelwriter/assets/icons/typicons_dark/icons.conf
index 46da8b3e..c347bf3c 100644
--- a/novelwriter/assets/icons/typicons_dark/icons.conf
+++ b/novelwriter/assets/icons/typicons_dark/icons.conf
@@ -34,11 +34,6 @@ cls_timeline = typ_calendar.svg
cls_trash = typ_trash.svg
cls_world = typ_location.svg
cross = typ_times.svg
-doc_h0 = mixed_heading0.svg
-doc_h1 = mixed_heading1.svg
-doc_h2 = mixed_heading2.svg
-doc_h3 = mixed_heading3.svg
-doc_h4 = mixed_heading4.svg
down = typ_chevron-down.svg
edit = typ_pencil.svg
forward = typ_chevron-right.svg
diff --git a/novelwriter/assets/icons/typicons_dark/mixed_heading0.svg b/novelwriter/assets/icons/typicons_dark/mixed_heading0.svg
deleted file mode 100644
index 65ca642c..00000000
--- a/novelwriter/assets/icons/typicons_dark/mixed_heading0.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/mixed_heading1.svg b/novelwriter/assets/icons/typicons_dark/mixed_heading1.svg
deleted file mode 100644
index faad4e82..00000000
--- a/novelwriter/assets/icons/typicons_dark/mixed_heading1.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/mixed_heading2.svg b/novelwriter/assets/icons/typicons_dark/mixed_heading2.svg
deleted file mode 100644
index 08c8ad09..00000000
--- a/novelwriter/assets/icons/typicons_dark/mixed_heading2.svg
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/mixed_heading3.svg b/novelwriter/assets/icons/typicons_dark/mixed_heading3.svg
deleted file mode 100644
index b5a35871..00000000
--- a/novelwriter/assets/icons/typicons_dark/mixed_heading3.svg
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_dark/mixed_heading4.svg b/novelwriter/assets/icons/typicons_dark/mixed_heading4.svg
deleted file mode 100644
index 718c0746..00000000
--- a/novelwriter/assets/icons/typicons_dark/mixed_heading4.svg
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/icons.conf b/novelwriter/assets/icons/typicons_light/icons.conf
index 7649328c..796b170f 100644
--- a/novelwriter/assets/icons/typicons_light/icons.conf
+++ b/novelwriter/assets/icons/typicons_light/icons.conf
@@ -34,11 +34,6 @@ cls_timeline = typ_calendar.svg
cls_trash = typ_trash.svg
cls_world = typ_location.svg
cross = typ_times.svg
-doc_h0 = mixed_heading0.svg
-doc_h1 = mixed_heading1.svg
-doc_h2 = mixed_heading2.svg
-doc_h3 = mixed_heading3.svg
-doc_h4 = mixed_heading4.svg
down = typ_chevron-down.svg
edit = typ_pencil.svg
forward = typ_chevron-right.svg
diff --git a/novelwriter/assets/icons/typicons_light/mixed_heading0.svg b/novelwriter/assets/icons/typicons_light/mixed_heading0.svg
deleted file mode 100644
index 87155b79..00000000
--- a/novelwriter/assets/icons/typicons_light/mixed_heading0.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/mixed_heading1.svg b/novelwriter/assets/icons/typicons_light/mixed_heading1.svg
deleted file mode 100644
index 89276c97..00000000
--- a/novelwriter/assets/icons/typicons_light/mixed_heading1.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/mixed_heading2.svg b/novelwriter/assets/icons/typicons_light/mixed_heading2.svg
deleted file mode 100644
index 5f69658e..00000000
--- a/novelwriter/assets/icons/typicons_light/mixed_heading2.svg
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/mixed_heading3.svg b/novelwriter/assets/icons/typicons_light/mixed_heading3.svg
deleted file mode 100644
index b7a33025..00000000
--- a/novelwriter/assets/icons/typicons_light/mixed_heading3.svg
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
diff --git a/novelwriter/assets/icons/typicons_light/mixed_heading4.svg b/novelwriter/assets/icons/typicons_light/mixed_heading4.svg
deleted file mode 100644
index 50b0b351..00000000
--- a/novelwriter/assets/icons/typicons_light/mixed_heading4.svg
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
diff --git a/novelwriter/dialogs/projdetails.py b/novelwriter/dialogs/projdetails.py
index 67ab6ebe..bcd5d0f5 100644
--- a/novelwriter/dialogs/projdetails.py
+++ b/novelwriter/dialogs/projdetails.py
@@ -512,10 +512,11 @@ class GuiProjectDetailsContents(QWidget):
progPage = f"{cPage:n}"
progText = f"{pgProg:.1f}{nwUnicode.U_THSP}%"
+ hDec = self.mainTheme.getHeaderDecoration(tLevel)
if tTitle.strip() == "":
tTitle = self.tr("Untitled")
- newItem.setIcon(self.C_TITLE, self.mainTheme.getIcon("doc_h%d" % tLevel))
+ newItem.setData(self.C_TITLE, Qt.DecorationRole, hDec)
newItem.setText(self.C_TITLE, tTitle)
newItem.setText(self.C_WORDS, f"{wCount:n}")
newItem.setText(self.C_PAGES, f"{pCount:n}")