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/gui/outline.py b/nw/gui/outline.py index 81cd805d..2d2716f8 100644 --- a/nw/gui/outline.py +++ b/nw/gui/outline.py @@ -351,8 +351,6 @@ class GuiOutline(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 @@ -446,9 +444,6 @@ class GuiOutline(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 GuiOutline diff --git a/nw/gui/projload.py b/nw/gui/projload.py index 45300332..06a32f72 100644 --- a/nw/gui/projload.py +++ b/nw/gui/projload.py @@ -94,9 +94,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") @@ -262,9 +259,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 2a4dc680..f7766ad5 100644 --- a/nw/gui/projsettings.py +++ b/nw/gui/projsettings.py @@ -461,14 +461,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) @@ -559,8 +553,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 66ba4639..7a3c98fb 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -83,14 +83,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. @@ -699,10 +691,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 549e25b5..80478624 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -197,9 +197,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) @@ -1021,6 +1023,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) @@ -1036,7 +1041,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