diff --git a/nw/assets/icons/typicons_colour_dark/calendar.svg b/nw/assets/icons/typicons_colour_dark/calendar.svg new file mode 100644 index 00000000..c55dbb89 --- /dev/null +++ b/nw/assets/icons/typicons_colour_dark/calendar.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_colour_dark/icons.conf b/nw/assets/icons/typicons_colour_dark/icons.conf index 76290410..b0e75498 100644 --- a/nw/assets/icons/typicons_colour_dark/icons.conf +++ b/nw/assets/icons/typicons_colour_dark/icons.conf @@ -21,7 +21,7 @@ cls_novel = book.svg cls_plot = puzzle.svg cls_character = user.svg cls_world = location.svg -cls_timeline = time.svg +cls_timeline = calendar.svg cls_object = key.svg cls_entity = flag.svg cls_custom = star.svg diff --git a/nw/assets/icons/typicons_colour_dark/time.svg b/nw/assets/icons/typicons_colour_dark/time.svg deleted file mode 100644 index ac0587cb..00000000 --- a/nw/assets/icons/typicons_colour_dark/time.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - diff --git a/nw/assets/icons/typicons_colour_light/calendar.svg b/nw/assets/icons/typicons_colour_light/calendar.svg new file mode 100644 index 00000000..bdaf6b28 --- /dev/null +++ b/nw/assets/icons/typicons_colour_light/calendar.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_colour_light/icons.conf b/nw/assets/icons/typicons_colour_light/icons.conf index 08042fc9..70477f64 100644 --- a/nw/assets/icons/typicons_colour_light/icons.conf +++ b/nw/assets/icons/typicons_colour_light/icons.conf @@ -21,7 +21,7 @@ cls_novel = book.svg cls_plot = puzzle.svg cls_character = user.svg cls_world = location.svg -cls_timeline = time.svg +cls_timeline = calendar.svg cls_object = key.svg cls_entity = flag.svg cls_custom = star.svg diff --git a/nw/assets/icons/typicons_colour_light/time.svg b/nw/assets/icons/typicons_colour_light/time.svg deleted file mode 100644 index 0ded9527..00000000 --- a/nw/assets/icons/typicons_colour_light/time.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - diff --git a/nw/assets/icons/typicons_grey_dark/calendar.svg b/nw/assets/icons/typicons_grey_dark/calendar.svg new file mode 100644 index 00000000..3bbfee8c --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/calendar.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/icons.conf b/nw/assets/icons/typicons_grey_dark/icons.conf index d81f4adf..d06201b1 100644 --- a/nw/assets/icons/typicons_grey_dark/icons.conf +++ b/nw/assets/icons/typicons_grey_dark/icons.conf @@ -21,7 +21,7 @@ cls_novel = book.svg cls_plot = puzzle.svg cls_character = user.svg cls_world = location.svg -cls_timeline = time.svg +cls_timeline = calendar.svg cls_object = key.svg cls_entity = flag.svg cls_custom = star.svg diff --git a/nw/assets/icons/typicons_grey_dark/time.svg b/nw/assets/icons/typicons_grey_dark/time.svg deleted file mode 100644 index 12f47768..00000000 --- a/nw/assets/icons/typicons_grey_dark/time.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/nw/assets/icons/typicons_grey_light/calendar.svg b/nw/assets/icons/typicons_grey_light/calendar.svg new file mode 100644 index 00000000..600a386d --- /dev/null +++ b/nw/assets/icons/typicons_grey_light/calendar.svg @@ -0,0 +1,55 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/icons.conf b/nw/assets/icons/typicons_grey_light/icons.conf index 2b26abc8..dd97c4c8 100644 --- a/nw/assets/icons/typicons_grey_light/icons.conf +++ b/nw/assets/icons/typicons_grey_light/icons.conf @@ -21,7 +21,7 @@ cls_novel = book.svg cls_plot = puzzle.svg cls_character = user.svg cls_world = location.svg -cls_timeline = time.svg +cls_timeline = calendar.svg cls_object = key.svg cls_entity = flag.svg cls_custom = star.svg diff --git a/nw/assets/icons/typicons_grey_light/time.svg b/nw/assets/icons/typicons_grey_light/time.svg deleted file mode 100644 index 9e47aa48..00000000 --- a/nw/assets/icons/typicons_grey_light/time.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/nw/assets/themes/gui/default/style.qss b/nw/assets/themes/gui/default/style.qss deleted file mode 100644 index 90ef623f..00000000 --- a/nw/assets/themes/gui/default/style.qss +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Default Theme: Light - */ - -QTreeView, QHeaderView { - font-size: 13px; -} diff --git a/nw/assets/themes/gui/default_dark/README.md b/nw/assets/themes/gui/default_dark/README.md deleted file mode 100644 index 36d11bcf..00000000 --- a/nw/assets/themes/gui/default_dark/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Default Dark Theme - -## Icons - -The following icons are from the typicons.font package on [GitHub](https://github.com/stephenhutchings/typicons.font): - -* globe.svg -* time.svg diff --git a/nw/assets/themes/gui/default_dark/icons/add.png b/nw/assets/themes/gui/default_dark/icons/add.png deleted file mode 100644 index 48632071..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/add.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/close.png b/nw/assets/themes/gui/default_dark/icons/close.png deleted file mode 100644 index e3ff6ae0..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/close.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/document.png b/nw/assets/themes/gui/default_dark/icons/document.png deleted file mode 100644 index 0d619034..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/document.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/folder.png b/nw/assets/themes/gui/default_dark/icons/folder.png deleted file mode 100644 index e7e36709..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/folder.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/globe.svg b/nw/assets/themes/gui/default_dark/icons/globe.svg deleted file mode 100644 index d56050b5..00000000 --- a/nw/assets/themes/gui/default_dark/icons/globe.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - diff --git a/nw/assets/themes/gui/default_dark/icons/orphan.png b/nw/assets/themes/gui/default_dark/icons/orphan.png deleted file mode 100644 index 1d2c1b26..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/orphan.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/remove.png b/nw/assets/themes/gui/default_dark/icons/remove.png deleted file mode 100644 index 0b218f87..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/remove.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/replace.png b/nw/assets/themes/gui/default_dark/icons/replace.png deleted file mode 100644 index 55155d97..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/replace.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/root.png b/nw/assets/themes/gui/default_dark/icons/root.png deleted file mode 100644 index a927c6d1..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/root.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/save.png b/nw/assets/themes/gui/default_dark/icons/save.png deleted file mode 100644 index 6b3c4496..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/save.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/search.png b/nw/assets/themes/gui/default_dark/icons/search.png deleted file mode 100644 index 8cdb5347..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/search.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/icons/time.svg b/nw/assets/themes/gui/default_dark/icons/time.svg deleted file mode 100644 index bdb740c1..00000000 --- a/nw/assets/themes/gui/default_dark/icons/time.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/nw/assets/themes/gui/default_dark/icons/trash.png b/nw/assets/themes/gui/default_dark/icons/trash.png deleted file mode 100644 index 96afbba0..00000000 Binary files a/nw/assets/themes/gui/default_dark/icons/trash.png and /dev/null differ diff --git a/nw/assets/themes/gui/default_dark/styles.qss b/nw/assets/themes/gui/default_dark/styles.qss index 6c847eb6..44f94ec6 100644 --- a/nw/assets/themes/gui/default_dark/styles.qss +++ b/nw/assets/themes/gui/default_dark/styles.qss @@ -1,7 +1,5 @@ /** * Default Theme: Dark + * This theme doesn't use any custom styles, so the file is only here as + * an example. There doesn't have to be a styles.qss file in the folder. */ - -QTreeView, QHeaderView { - font-size: 13px; -} diff --git a/nw/core/tohtml.py b/nw/core/tohtml.py index c451daaf..282717b3 100644 --- a/nw/core/tohtml.py +++ b/nw/core/tohtml.py @@ -269,6 +269,7 @@ class ToHtml(Tokenizer): theStyles.append(r"h1, h2 {color: rgb(66, 113, 174);}") theStyles.append(r"h3, h4 {color: rgb(50, 50, 50);}") theStyles.append(r"h1, h2, h3, h4 {page-break-after: avoid;}") + theStyles.append(r"a {color: rgb(66, 113, 174);}") theStyles.append(r".title {font-size: 2.5em;}") theStyles.append(r".tags {color: rgb(245, 135, 31); font-weight: bold;}") theStyles.append(r".break {text-align: left;}") diff --git a/nw/gui/build.py b/nw/gui/build.py index f072b6ea..df812c95 100644 --- a/nw/gui/build.py +++ b/nw/gui/build.py @@ -961,8 +961,7 @@ class GuiBuildNovelDocView(QTextBrowser): if not theStyles: theStyles.append(r"h1, h2 {color: rgb(66, 113, 174);}") theStyles.append(r"h3, h4 {color: rgb(50, 50, 50);}") - theStyles.append(r"a {color: rgb(137, 89, 168);}") - theStyles.append(r"mark {background-color: rgb(240, 198, 116);}") + theStyles.append(r"a {color: rgb(66, 113, 174);}") theStyles.append(r".tags {color: rgb(245, 135, 31); font-weight: bold;}") self.qDocument.setDefaultStyleSheet("\n".join(theStyles)) diff --git a/nw/gui/outline.py b/nw/gui/outline.py index 12c26383..ada3c0a8 100644 --- a/nw/gui/outline.py +++ b/nw/gui/outline.py @@ -339,8 +339,6 @@ class GuiProjectOutline(QTreeWidget): headItem.setTextAlignment(self.colIndex[nwOutline.CCOUNT], Qt.AlignRight) headItem.setTextAlignment(self.colIndex[nwOutline.WCOUNT], Qt.AlignRight) headItem.setTextAlignment(self.colIndex[nwOutline.PCOUNT], Qt.AlignRight) - for hItem in self.treeOrder: - headItem.setFont(self.colIndex[hItem], self.theTheme.guiFont) currTitle = None currChapter = None @@ -433,9 +431,6 @@ class GuiProjectOutline(QTreeWidget): newItem.setText(self.colIndex[nwOutline.ENTITY], ", ".join(theRefs[nwKeyWords.ENTITY_KEY])) newItem.setText(self.colIndex[nwOutline.CUSTOM], ", ".join(theRefs[nwKeyWords.CUSTOM_KEY])) - for i in self.treeOrder: - newItem.setFont(self.colIndex[i], self.theTheme.guiFont) - return newItem # END Class GuiProjectOutline diff --git a/nw/gui/projload.py b/nw/gui/projload.py index 63f0be9f..282a69f7 100644 --- a/nw/gui/projload.py +++ b/nw/gui/projload.py @@ -92,9 +92,6 @@ class GuiProjectLoad(QDialog): treeHead = self.listBox.headerItem() treeHead.setTextAlignment(1, Qt.AlignRight) treeHead.setTextAlignment(2, Qt.AlignRight) - treeHead.setFont(0, self.theTheme.guiFont) - treeHead.setFont(1, self.theTheme.guiFont) - treeHead.setFont(2, self.theTheme.guiFont) self.lblRecent = QLabel("Recently Opened Projects") self.lblPath = QLabel("Path") @@ -260,9 +257,6 @@ class GuiProjectLoad(QDialog): newItem.setTextAlignment(0, Qt.AlignLeft | Qt.AlignVCenter) newItem.setTextAlignment(1, Qt.AlignRight | Qt.AlignVCenter) newItem.setTextAlignment(2, Qt.AlignRight | Qt.AlignVCenter) - newItem.setFont(0, self.theTheme.guiFont) - newItem.setFont(1, self.theTheme.guiFont) - newItem.setFont(2, self.theTheme.guiFont) self.listBox.addTopLevelItem(newItem) if not hasSelection: newItem.setSelected(True) diff --git a/nw/gui/projsettings.py b/nw/gui/projsettings.py index a1c28ca4..3722d41c 100644 --- a/nw/gui/projsettings.py +++ b/nw/gui/projsettings.py @@ -450,14 +450,8 @@ class GuiProjectEditReplace(QWidget): self.listBox.itemSelectionChanged.connect(self._selectedItem) self.listBox.setIndentation(0) - treeHead = self.listBox.headerItem() - treeHead.setFont(0, self.theTheme.guiFont) - treeHead.setFont(1, self.theTheme.guiFont) - for aKey, aVal in self.theProject.autoReplace.items(): newItem = QTreeWidgetItem(["<%s>" % aKey, aVal]) - newItem.setFont(0, self.theTheme.guiFont) - newItem.setFont(1, self.theTheme.guiFont) self.listBox.addTopLevelItem(newItem) self.listBox.sortByColumn(0, Qt.AscendingOrder) @@ -548,8 +542,6 @@ class GuiProjectEditReplace(QWidget): saveKey = "" % (self.listBox.topLevelItemCount() + 1) newVal = "" newItem = QTreeWidgetItem([saveKey, newVal]) - newItem.setFont(0, self.theTheme.guiFont) - newItem.setFont(1, self.theTheme.guiFont) self.listBox.addTopLevelItem(newItem) return True diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 72246c3a..312d3a75 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -79,14 +79,6 @@ class GuiProjectTree(QTreeWidget): treeHeadItem.setToolTip(self.C_EXPORT, "Include in build") treeHeadItem.setToolTip(self.C_FLAGS, "Status, class, and layout flags") - # Force the font to fix font sizing issues on some platforms - # like Ubuntu. This must also be set when the rows are added. - self.setFont(self.theTheme.guiFont) - treeHeadItem.setFont(self.C_NAME, self.theTheme.guiFont) - treeHeadItem.setFont(self.C_COUNT,self.theTheme.guiFont) - treeHeadItem.setFont(self.C_EXPORT, self.theTheme.guiFont) - treeHeadItem.setFont(self.C_FLAGS, self.theTheme.guiFont) - # Let the last column stretch, and set the minimum size to the # size of the icon as the default Qt font metrics approach fails # for some fonts like the Ubuntu font. @@ -599,10 +591,6 @@ class GuiProjectTree(QTreeWidget): newItem.setTextAlignment(self.C_EXPORT, Qt.AlignLeft | Qt.AlignVCenter) newItem.setTextAlignment(self.C_FLAGS, Qt.AlignLeft | Qt.AlignVCenter) - newItem.setFont(self.C_NAME, self.theTheme.guiFont) - newItem.setFont(self.C_COUNT, self.theTheme.guiFont) - newItem.setFont(self.C_FLAGS, self.theTheme.guiFont) - newItem.setData(self.C_NAME, Qt.UserRole, tHandle) self.theMap[tHandle] = newItem diff --git a/nw/guimain.py b/nw/guimain.py index ea6c050e..e50b23c9 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -193,9 +193,11 @@ class GuiMain(QMainWindow): # Shortcuts and Actions self._connectMenuActions() + keyReturn = QShortcut(self.treeView) keyReturn.setKey(QKeySequence(Qt.Key_Return)) keyReturn.activated.connect(self._treeKeyPressReturn) + keyEscape = QShortcut(self) keyEscape.setKey(QKeySequence(Qt.Key_Escape)) keyEscape.activated.connect(self._keyPressEscape) @@ -1014,6 +1016,9 @@ class GuiMain(QMainWindow): ## def _treeSingleClick(self): + """Single click on a project tree item just updates the details + panel below the tree. + """ sHandle = self.treeView.getSelectedHandle() if sHandle is not None: self.treeMeta.updateViewBox(sHandle) @@ -1029,7 +1034,7 @@ class GuiMain(QMainWindow): if nwItem is not None: if nwItem.itemType == nwItemType.FILE: logger.verbose("Requested item %s is a file" % tHandle) - self.openDocument(tHandle) + self.openDocument(tHandle, changeFocus=False) else: logger.verbose("Requested item %s is a folder" % tHandle) return diff --git a/tests/reference/build/1_LoremIpsum.htm b/tests/reference/build/1_LoremIpsum.htm index 4faf5f79..a3e4432f 100644 --- a/tests/reference/build/1_LoremIpsum.htm +++ b/tests/reference/build/1_LoremIpsum.htm @@ -9,6 +9,7 @@ p {text-align: left;} h1, h2 {color: rgb(66, 113, 174);} h3, h4 {color: rgb(50, 50, 50);} h1, h2, h3, h4 {page-break-after: avoid;} +a {color: rgb(66, 113, 174);} .title {font-size: 2.5em;} .tags {color: rgb(245, 135, 31); font-weight: bold;} .break {text-align: left;} diff --git a/tests/reference/build/2_LoremIpsum.htm b/tests/reference/build/2_LoremIpsum.htm index 7ea871c2..3bbbe9a1 100644 --- a/tests/reference/build/2_LoremIpsum.htm +++ b/tests/reference/build/2_LoremIpsum.htm @@ -9,6 +9,7 @@ p {text-align: justify;} h1, h2 {color: rgb(66, 113, 174);} h3, h4 {color: rgb(50, 50, 50);} h1, h2, h3, h4 {page-break-after: avoid;} +a {color: rgb(66, 113, 174);} .title {font-size: 2.5em;} .tags {color: rgb(245, 135, 31); font-weight: bold;} .break {text-align: left;} diff --git a/tests/reference/build/3_LoremIpsum.htm b/tests/reference/build/3_LoremIpsum.htm index a9c2e695..cbd64275 100644 --- a/tests/reference/build/3_LoremIpsum.htm +++ b/tests/reference/build/3_LoremIpsum.htm @@ -9,6 +9,7 @@ p {text-align: justify;} h1, h2 {color: rgb(66, 113, 174);} h3, h4 {color: rgb(50, 50, 50);} h1, h2, h3, h4 {page-break-after: avoid;} +a {color: rgb(66, 113, 174);} .title {font-size: 2.5em;} .tags {color: rgb(245, 135, 31); font-weight: bold;} .break {text-align: left;}