diff --git a/nw/assets/icons/fallback/reference-dark.svg b/nw/assets/icons/fallback/reference-dark.svg new file mode 100644 index 00000000..e57b19b0 --- /dev/null +++ b/nw/assets/icons/fallback/reference-dark.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/fallback/reference.svg b/nw/assets/icons/fallback/reference.svg new file mode 100644 index 00000000..09202533 --- /dev/null +++ b/nw/assets/icons/fallback/reference.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/fallback/sticky-off-dark.svg b/nw/assets/icons/fallback/sticky-off-dark.svg new file mode 100644 index 00000000..f571d5c9 --- /dev/null +++ b/nw/assets/icons/fallback/sticky-off-dark.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/fallback/sticky-off.svg b/nw/assets/icons/fallback/sticky-off.svg new file mode 100644 index 00000000..57b2b498 --- /dev/null +++ b/nw/assets/icons/fallback/sticky-off.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/fallback/sticky-on-dark.svg b/nw/assets/icons/fallback/sticky-on-dark.svg new file mode 100644 index 00000000..62c6a66b --- /dev/null +++ b/nw/assets/icons/fallback/sticky-on-dark.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/fallback/sticky-on.svg b/nw/assets/icons/fallback/sticky-on.svg new file mode 100644 index 00000000..3473b82f --- /dev/null +++ b/nw/assets/icons/fallback/sticky-on.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_colour_dark/bookmark.svg b/nw/assets/icons/typicons_colour_dark/bookmark.svg new file mode 100644 index 00000000..e56ebbee --- /dev/null +++ b/nw/assets/icons/typicons_colour_dark/bookmark.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_colour_dark/icons.conf b/nw/assets/icons/typicons_colour_dark/icons.conf index f55adaa9..3f8b547f 100644 --- a/nw/assets/icons/typicons_colour_dark/icons.conf +++ b/nw/assets/icons/typicons_colour_dark/icons.conf @@ -49,3 +49,6 @@ edit = pencil.svg check = tick.svg cross = times.svg hash = hash.svg +reference = bookmark.svg +sticky-on = pin.svg +sticky-off = pin-outline.svg diff --git a/nw/assets/icons/typicons_colour_dark/pin-outline.svg b/nw/assets/icons/typicons_colour_dark/pin-outline.svg new file mode 100644 index 00000000..478ff1a6 --- /dev/null +++ b/nw/assets/icons/typicons_colour_dark/pin-outline.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_colour_dark/pin.svg b/nw/assets/icons/typicons_colour_dark/pin.svg new file mode 100644 index 00000000..ea040440 --- /dev/null +++ b/nw/assets/icons/typicons_colour_dark/pin.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_colour_light/bookmark.svg b/nw/assets/icons/typicons_colour_light/bookmark.svg new file mode 100644 index 00000000..3936ba30 --- /dev/null +++ b/nw/assets/icons/typicons_colour_light/bookmark.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_colour_light/icons.conf b/nw/assets/icons/typicons_colour_light/icons.conf index af948e10..b080af1d 100644 --- a/nw/assets/icons/typicons_colour_light/icons.conf +++ b/nw/assets/icons/typicons_colour_light/icons.conf @@ -49,3 +49,6 @@ edit = pencil.svg check = tick.svg cross = times.svg hash = hash.svg +reference = bookmark.svg +sticky-on = pin.svg +sticky-off = pin-outline.svg diff --git a/nw/assets/icons/typicons_colour_light/pin-outline.svg b/nw/assets/icons/typicons_colour_light/pin-outline.svg new file mode 100644 index 00000000..9091424e --- /dev/null +++ b/nw/assets/icons/typicons_colour_light/pin-outline.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_colour_light/pin.svg b/nw/assets/icons/typicons_colour_light/pin.svg new file mode 100644 index 00000000..372928f7 --- /dev/null +++ b/nw/assets/icons/typicons_colour_light/pin.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/bookmark.svg b/nw/assets/icons/typicons_grey_dark/bookmark.svg new file mode 100644 index 00000000..e57b19b0 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/bookmark.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/icons.conf b/nw/assets/icons/typicons_grey_dark/icons.conf index b8b24e46..0a68c931 100644 --- a/nw/assets/icons/typicons_grey_dark/icons.conf +++ b/nw/assets/icons/typicons_grey_dark/icons.conf @@ -49,3 +49,6 @@ edit = pencil.svg check = tick.svg cross = times.svg hash = hash.svg +reference = bookmark.svg +sticky-on = pin.svg +sticky-off = pin-outline.svg diff --git a/nw/assets/icons/typicons_grey_dark/pin-outline.svg b/nw/assets/icons/typicons_grey_dark/pin-outline.svg new file mode 100644 index 00000000..f571d5c9 --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/pin-outline.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_dark/pin.svg b/nw/assets/icons/typicons_grey_dark/pin.svg new file mode 100644 index 00000000..62c6a66b --- /dev/null +++ b/nw/assets/icons/typicons_grey_dark/pin.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/nw/assets/icons/typicons_grey_light/bookmark.svg b/nw/assets/icons/typicons_grey_light/bookmark.svg index 0d97d10d..42556b6b 100644 --- a/nw/assets/icons/typicons_grey_light/bookmark.svg +++ b/nw/assets/icons/typicons_grey_light/bookmark.svg @@ -5,10 +5,6 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - inkscape:version="1.0 (4035a4fb49, 2020-05-01)" - sodipodi:docname="bookmark.svg" id="svg2608" viewBox="0 0 24 24" height="24" @@ -28,26 +24,6 @@ - + height="24" + viewBox="0 0 24 24" + id="svg5619"> @@ -28,28 +24,8 @@ - + style="stroke-width:1.17614;fill:#000000;fill-opacity:0.78039217" /> diff --git a/nw/assets/icons/typicons_grey_light/pin.svg b/nw/assets/icons/typicons_grey_light/pin.svg index 9fd617a4..3473b82f 100644 --- a/nw/assets/icons/typicons_grey_light/pin.svg +++ b/nw/assets/icons/typicons_grey_light/pin.svg @@ -5,15 +5,11 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - inkscape:version="1.0 (4035a4fb49, 2020-05-01)" - sodipodi:docname="pin.svg" - id="svg4924" - viewBox="0 0 24 24" - height="24" + version="1.2" width="24" - version="1.2"> + height="24" + viewBox="0 0 24 24" + id="svg4924"> @@ -28,28 +24,8 @@ - + style="stroke-width:1.24817;fill:#000000;fill-opacity:0.78039217" /> diff --git a/nw/gui/docdetails.py b/nw/gui/docdetails.py deleted file mode 100644 index 170ce1dd..00000000 --- a/nw/gui/docdetails.py +++ /dev/null @@ -1,164 +0,0 @@ -# -*- coding: utf-8 -*- -"""novelWriter GUI DocView Details - - novelWriter – GUI DocView Details -=================================== - Class holding the document view details panel - - File History: - Created: 2019-10-31 [0.3.2] - - This file is a part of novelWriter - Copyright 2020, Veronica Berglyd Olsen - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -""" - -import logging -import nw - -from PyQt5.QtCore import Qt, QSize -from PyQt5.QtWidgets import ( - QWidget, QLabel, QScrollArea, QFrame, QToolButton, QCheckBox, QGridLayout, QHBoxLayout -) - -logger = logging.getLogger(__name__) - -class GuiDocViewDetails(QScrollArea): - - def __init__(self, theParent): - QScrollArea.__init__(self, theParent) - - logger.debug("Initialising DocViewDetails ...") - self.mainConf = nw.CONFIG - self.theParent = theParent - self.theProject = theParent.theProject - self.theTheme = theParent.theTheme - self.currHandle = None - - # x4 = self.mainConf.pxInt(4) - # x80 = self.mainConf.pxInt(80) - # iPx = self.theTheme.textIconSize - - # self.outerBox = QGridLayout(self) - # self.outerBox.setContentsMargins(0, 0, 0, 0) - # self.outerBox.setHorizontalSpacing(0) - # self.outerBox.setVerticalSpacing(x4) - - # self.refLabel = QLabel("Referenced By", self) - - # self.showHide = QToolButton() - # self.showHide.setStyleSheet("QToolButton { border: none; }") - # self.showHide.setToolButtonStyle(Qt.ToolButtonIconOnly) - # self.showHide.setArrowType(Qt.DownArrow) - # self.showHide.setCheckable(True) - # self.showHide.setIconSize(QSize(iPx, iPx)) - # self.showHide.toggled.connect(self._doShowHide) - - # self.isSticky = QCheckBox("Sticky") - # self.isSticky.setChecked(False) - # self.isSticky.toggled.connect(self._doSticky) - - self.refList = QLabel("None") - self.refList.setWordWrap(True) - self.refList.setAlignment(Qt.AlignTop) - self.refList.setScaledContents(True) - self.refList.linkActivated.connect(self._linkClicked) - - # self.scrollBox = QScrollArea() - # self.scrollBox.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) - # self.scrollBox.setFrameStyle(QFrame.NoFrame) - # self.scrollBox.setWidgetResizable(True) - # self.scrollBox.setFixedHeight(x80) - # self.scrollBox.setWidget(self.refList) - - # self.outerBox.addWidget(self.showHide, 0, 0) - # self.outerBox.addWidget(self.refLabel, 0, 1) - # self.outerBox.addWidget(self.isSticky, 0, 2) - # self.outerBox.addWidget(self.scrollBox, 1, 1, 1, 2) - # self.outerBox.setColumnStretch(1, 1) - - # Assemble - self.outerWidget = QWidget() - self.outerBox = QHBoxLayout() - self.outerBox.addWidget(self.refList, 1) - - self.outerWidget.setLayout(self.outerBox) - self.setWidget(self.outerWidget) - - self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) - self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) - self.setWidgetResizable(True) - self.setMinimumHeight(self.mainConf.pxInt(50)) - - logger.debug("DocViewDetails initialisation complete") - - return - - def refreshReferences(self, tHandle): - """Update the current list of document references from the - project index. - """ - self.currHandle = tHandle - if self.theParent.docViewer.stickyRef: - return - - theRefs = self.theParent.theIndex.getBackReferenceList(tHandle) - theList = [] - for tHandle in theRefs: - tItem = self.theProject.projTree[tHandle] - if tItem is not None: - for n in range(10): - theList.append("%s" % ( - tHandle, theRefs[tHandle], tItem.itemName - )) - - self.refList.setText(", ".join(theList)) - self.refList.adjustSize() - - return - - ## - # Internal Functions - ## - - def _linkClicked(self, theLink): - """Capture the link-click and forward it to the document viewer - class for handling. - """ - logger.verbose("Clicked link: '%s'" % theLink) - if len(theLink) == 27: - tHandle = theLink[6:19] - self.theParent.viewDocument(tHandle, theLink) - return - - # def _doShowHide(self, chState): - # """Toggle the expand/collapse of the panel. - # """ - # self.scrollBox.setVisible(chState) - # self.mainConf.setShowRefPanel(chState) - # if chState: - # self.showHide.setArrowType(Qt.DownArrow) - # else: - # self.showHide.setArrowType(Qt.RightArrow) - # return - - # def _doSticky(self, chState): - # """Toggle the sticky feature of the references. - # """ - # if not chState and self.currHandle is not None: - # self.refreshReferences(self.currHandle) - # return - -# END Class GuiDocViewDetails