Viewer footer now works and references button shows/hides the references

This commit is contained in:
Veronica K. B. Olsen
2020-06-09 21:47:39 +02:00
parent ef70e63814
commit a24134d4d6
10 changed files with 285 additions and 86 deletions
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
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"
width="24"
version="1.2">
<metadata
id="metadata2614">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs2612" />
<sodipodi:namedview
inkscape:current-layer="svg2608"
inkscape:window-maximized="1"
inkscape:window-y="1"
inkscape:window-x="2560"
inkscape:cy="13.897227"
inkscape:cx="11.879814"
inkscape:zoom="34.117902"
showgrid="false"
id="namedview2610"
inkscape:window-height="1370"
inkscape:window-width="2560"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<path
style="stroke-width:1.05081;fill:#000000;fill-opacity:0.78039217"
id="path2606"
d="M 16.203226,2 H 7.796774 C 6.05874,2 4.6443545,3.4143855 4.6443545,5.1524195 V 19.86371 c 0,0.540115 0.1092839,0.994063 0.3236484,1.350287 0.5926549,0.982504 1.9072138,1.059213 2.9559187,0.0084 L 11.25708,17.889239 c 0.394052,-0.393002 1.091787,-0.393002 1.485841,0 l 3.333158,3.333158 C 16.592024,21.738349 17.128987,22 17.673304,22 c 0.837492,0 1.682342,-0.660957 1.682342,-2.13629 V 5.1524195 C 19.355646,3.4143855 17.941259,2 16.203226,2 Z M 7.796774,4.101613 h 8.406452 c 0.578994,0 1.050806,0.4718121 1.050806,1.0508065 V 15.560658 l -2.575527,-2.361162 c -1.477434,-1.35449 -3.880628,-1.353439 -5.3580615,0 l -2.574476,2.361162 V 5.1524195 c 0,-0.5789944 0.4718121,-1.0508065 1.0508065,-1.0508065 z m 6.431987,12.301792 C 13.635055,15.809699 12.843798,15.482898 12,15.482898 c -0.843797,0 -1.635054,0.327852 -2.2287605,0.920507 l -3.025272,3.025272 v -2.442075 l 3.2848215,-3.011611 c 1.085483,-0.995114 2.851889,-0.995114 3.937372,0 l 3.285871,3.011611 v 2.442075 z" />
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

@@ -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
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
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-outline.svg"
id="svg5619"
viewBox="0 0 24 24"
height="24"
width="24"
version="1.2">
<metadata
id="metadata5625">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs5623" />
<sodipodi:namedview
inkscape:current-layer="svg5619"
inkscape:window-maximized="1"
inkscape:window-y="1"
inkscape:window-x="2560"
inkscape:cy="12"
inkscape:cx="12"
inkscape:zoom="38.125"
showgrid="false"
id="namedview5621"
inkscape:window-height="1370"
inkscape:window-width="2560"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<path
style="stroke-width:1.17614;fill:#000000;fill-opacity:0.78039217"
id="path5617"
d="M 21.321794,7.3993841 16.619582,2.6712968 C 15.735124,1.7821341 14.193203,1.772725 13.291103,2.6642399 13.060579,2.8947636 12.879453,3.1770375 12.799476,3.4040327 12.031456,5.0059369 11.206981,6.0091853 10.148454,6.6113695 L 9.8932312,6.7348644 c -1.138504,0.5704284 -2.687482,1.1514421 -5.5502098,1.1514421 -0.3128535,0 -0.6127695,0.061159 -0.9009241,0.1787735 -0.5692523,0.2375805 -1.033828,0.6998039 -1.2725846,1.2749371 -0.2340521,0.569252 -0.2340521,1.2243629 0,1.7936149 0.1223186,0.292859 0.2940352,0.553963 0.5116213,0.765668 L 6.4859506,15.704116 1.9907392,22 l 6.294707,-4.495212 3.7954078,3.795408 c 0.218762,0.222291 0.477513,0.398712 0.771548,0.518678 C 13.142909,21.940017 13.444001,22 13.753326,22 c 0.309325,0 0.610418,-0.06116 0.899748,-0.181126 0.585719,-0.241109 1.038533,-0.696275 1.270233,-1.26788 0.121142,-0.284626 0.182302,-0.596304 0.182302,-0.903276 0,-2.86508 0.581013,-4.412882 1.150266,-5.552563 0.583366,-1.166732 1.610137,-2.055894 3.239092,-2.839204 0.318734,-0.122319 0.599832,-0.301092 0.836237,-0.537497 0.907981,-0.9197419 0.903276,-2.4122651 -0.0094,-3.3190699 z m -6.172388,5.6466539 c -0.96326,1.932399 -1.397256,3.963595 -1.405489,6.591094 L 4.3430214,10.238589 c 2.5157659,0 4.4858018,-0.3940079 6.3464576,-1.2749372 L 10.965872,8.840157 c 1.645421,-0.8221227 2.902716,-2.2264352 3.984766,-4.5093251 l 4.615178,4.7645472 c -2.191151,1.0502949 -3.594287,2.3052369 -4.41641,3.9506589 z" />
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
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"
width="24"
version="1.2">
<metadata
id="metadata4930">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs4928" />
<sodipodi:namedview
inkscape:current-layer="svg4924"
inkscape:window-maximized="1"
inkscape:window-y="1"
inkscape:window-x="2560"
inkscape:cy="12"
inkscape:cx="12"
inkscape:zoom="38.125"
showgrid="false"
id="namedview4926"
inkscape:window-height="1370"
inkscape:window-width="2560"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" />
<path
style="stroke-width:1.24817;fill:#000000;fill-opacity:0.78039217"
id="path4922"
d="M 16.641616,2.36759 C 16.156078,1.879557 15.367237,1.8770607 14.876708,2.3626 14.7469,2.4924093 14.657031,2.6459337 14.595871,2.8056991 13.557396,4.9725159 12.414076,6.1944709 10.971195,6.915911 9.3523243,7.7147375 7.4938043,8.270172 4.4982051,8.270172 c -0.1622616,0 -0.3245233,0.0312 -0.4767996,0.09486 -0.3058008,0.127313 -0.547945,0.370705 -0.675258,0.675258 -0.1260648,0.304552 -0.1260648,0.649046 0,0.953599 0.063657,0.153524 0.1547727,0.292071 0.2708521,0.406902 L 7.6648033,14.448593 2.0018723,22 l 7.551407,-5.662931 4.0465547,4.046555 c 0.114831,0.117328 0.253378,0.207196 0.406902,0.270852 0.152277,0.06366 0.314538,0.09736 0.4768,0.09736 0.162261,0 0.324524,-0.0337 0.476799,-0.09736 0.305801,-0.127313 0.549193,-0.36821 0.675259,-0.675259 0.06366,-0.151027 0.09611,-0.314537 0.09611,-0.475551 0,-2.995598 0.554186,-4.854118 1.351763,-6.448027 0.720193,-1.44288 1.942148,-2.586201 4.110213,-3.624676 0.161013,-0.06115 0.31329,-0.151028 0.441851,-0.280836 0.485536,-0.49053 0.48304,-1.2793713 -0.005,-1.7649081 z" />
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

+28 -3
View File
@@ -33,7 +33,7 @@ from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QPalette, QColor
from PyQt5.QtWidgets import (
qApp, QWidget, QFrame, QGridLayout, QLabel, QLineEdit, QPushButton,
QHBoxLayout
QHBoxLayout, QToolButton
)
from nw.constants import nwDocAction, nwUnicode
@@ -370,9 +370,22 @@ class GuiDocViewFooter(QWidget):
self.setAutoFillBackground(True)
self.setPalette(self.thePalette)
# Show/Hide Details
self.showHide = QToolButton()
self.showHide.setStyleSheet("QToolButton { border: none; background: transparent; }")
self.showHide.setToolButtonStyle(Qt.ToolButtonIconOnly)
self.showHide.setIcon(self.theTheme.getIcon("reference"))
self.showHide.setFixedSize(QSize(fPx, fPx))
self.showHide.setIconSize(QSize(fPx, fPx))
self.showHide.clicked.connect(self._doShowHide)
# Title Label
self.theTitle = QLabel()
self.theTitle.setText("References")
self.theTitle = QLabel("References")
self.theTitle.setIndent(0)
self.theTitle.setMargin(0)
self.theTitle.setContentsMargins(0, 0, 0, 0)
self.theTitle.setAlignment(Qt.AlignLeft | Qt.AlignTop)
self.theTitle.setFixedHeight(fPx)
lblFont = self.theTitle.font()
lblFont.setPointSizeF(0.9*self.theTheme.fontPointSize)
@@ -381,6 +394,7 @@ class GuiDocViewFooter(QWidget):
# Assemble Layout
self.outerBox = QHBoxLayout()
self.outerBox.setSpacing(hSp)
self.outerBox.addWidget(self.showHide, 0)
self.outerBox.addWidget(self.theTitle, 1)
self.setLayout(self.outerBox)
@@ -388,4 +402,15 @@ class GuiDocViewFooter(QWidget):
return
##
# Slots
##
def _doShowHide(self):
"""Toggle the expand/collapse of the panel.
"""
isVisible = self.theParent.theParent.viewMeta.isVisible()
self.theParent.theParent.viewMeta.setVisible(not isVisible)
return
# END Class GuiDocViewFooter
+64 -56
View File
@@ -30,15 +30,15 @@ import nw
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtWidgets import (
QWidget, QLabel, QScrollArea, QFrame, QToolButton, QCheckBox, QGridLayout
QWidget, QLabel, QScrollArea, QFrame, QToolButton, QCheckBox, QGridLayout, QHBoxLayout
)
logger = logging.getLogger(__name__)
class GuiDocViewDetails(QWidget):
class GuiDocViewDetails(QScrollArea):
def __init__(self, theParent):
QWidget.__init__(self, theParent)
QScrollArea.__init__(self, theParent)
logger.debug("Initialising DocViewDetails ...")
self.mainConf = nw.CONFIG
@@ -47,28 +47,28 @@ class GuiDocViewDetails(QWidget):
self.theTheme = theParent.theTheme
self.currHandle = None
x4 = self.mainConf.pxInt(4)
x80 = self.mainConf.pxInt(80)
iPx = self.theTheme.textIconSize
# 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.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.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.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.isSticky = QCheckBox("Sticky")
# self.isSticky.setChecked(False)
# self.isSticky.toggled.connect(self._doSticky)
self.refList = QLabel("None")
self.refList.setWordWrap(True)
@@ -76,23 +76,31 @@ class GuiDocViewDetails(QWidget):
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.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)
# 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)
self.setLayout(self.outerBox)
self.setContentsMargins(0, 0, 0, 0)
# Assemble
self.outerWidget = QWidget()
self.outerBox = QHBoxLayout()
self.outerBox.addWidget(self.refList, 1)
self._doShowHide(self.mainConf.showRefPanel)
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")
@@ -103,8 +111,7 @@ class GuiDocViewDetails(QWidget):
project index.
"""
self.currHandle = tHandle
if self.isSticky.isChecked():
if self.theParent.docViewer.stickyRef:
return
theRefs = self.theParent.theIndex.getBackReferenceList(tHandle)
@@ -112,9 +119,10 @@ class GuiDocViewDetails(QWidget):
for tHandle in theRefs:
tItem = self.theProject.projTree[tHandle]
if tItem is not None:
theList.append("<a href='#head_%s:%s'>%s</a>" % (
tHandle, theRefs[tHandle], tItem.itemName
))
for n in range(10):
theList.append("<a href='#head_%s:%s'>%s</a>" % (
tHandle, theRefs[tHandle], tItem.itemName
))
self.refList.setText(", ".join(theList))
self.refList.adjustSize()
@@ -135,22 +143,22 @@ class GuiDocViewDetails(QWidget):
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 _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
# 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
+1
View File
@@ -60,6 +60,7 @@ class GuiDocViewer(QTextBrowser):
# Document Title and Footer
self.docTitle = GuiDocTitleBar(self, self.theProject, isEditor=False)
self.docFooter = GuiDocViewFooter(self, self.theProject)
self.stickyRef = False
theOpt = QTextOption()
if self.mainConf.doJustify:
-2
View File
@@ -216,11 +216,9 @@ class GuiOutlineDetails(QScrollArea):
self.outerBox = QHBoxLayout()
self.outerBox.addWidget(self.mainGroup, 0)
self.outerBox.addWidget(self.tagsGroup, 1)
# self.outerBox.addStretch(1)
self.outerWidget.setLayout(self.outerBox)
self.setWidget(self.outerWidget)
self.show()
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
+3
View File
@@ -537,6 +537,9 @@ class GuiIcons:
"maximise" : (None, None),
"minimise" : (None, None),
"refresh" : (None, None),
"reference" : (None, None),
"sticky-on" : (None, None),
"sticky-off" : (None, None),
## Other Icons
"warning" : (QStyle.SP_MessageBoxWarning, "dialog-warning"),
+21 -25
View File
@@ -120,17 +120,8 @@ class GuiMain(QMainWindow):
self.docEdit.addWidget(self.docEditor)
self.editPane.setLayout(self.docEdit)
self.viewPane = QWidget()
self.docView = QVBoxLayout()
self.docView.setContentsMargins(0, 0, 0, 0)
self.docView.setSpacing(self.mainConf.pxInt(2))
self.docView.addWidget(self.docViewer)
# self.docView.addWidget(self.viewMeta)
self.docView.setStretch(0, 1)
self.viewPane.setLayout(self.docView)
self.splitView = QSplitter(Qt.Vertical)
self.splitView.addWidget(self.viewPane)
self.splitView.addWidget(self.docViewer)
self.splitView.addWidget(self.viewMeta)
self.splitView.setSizes(self.mainConf.getViewPanePos())
@@ -161,20 +152,23 @@ class GuiMain(QMainWindow):
self.setCentralWidget(self.splitMain)
self.idxTree = self.splitMain.indexOf(self.treePane)
self.idxMain = self.splitMain.indexOf(self.tabWidget)
self.idxEditor = self.splitDocs.indexOf(self.editPane)
self.idxViewer = self.splitDocs.indexOf(self.viewPane)
self.idxTabEdit = self.tabWidget.indexOf(self.splitDocs)
self.idxTabProj = self.tabWidget.indexOf(self.splitOutline)
self.idxTree = self.splitMain.indexOf(self.treePane)
self.idxMain = self.splitMain.indexOf(self.tabWidget)
self.idxEditor = self.splitDocs.indexOf(self.editPane)
self.idxViewer = self.splitDocs.indexOf(self.splitView)
self.idxViewDoc = self.splitView.indexOf(self.docViewer)
self.idxViewMeta = self.splitView.indexOf(self.viewMeta)
self.idxTabEdit = self.tabWidget.indexOf(self.splitDocs)
self.idxTabProj = self.tabWidget.indexOf(self.splitOutline)
self.splitMain.setCollapsible(self.idxTree, False)
self.splitMain.setCollapsible(self.idxMain, False)
self.splitDocs.setCollapsible(self.idxEditor, False)
self.splitDocs.setCollapsible(self.idxViewer, True)
self.splitView.setCollapsible(self.idxViewDoc, False)
self.splitView.setCollapsible(self.idxViewMeta, False)
self.viewPane.setVisible(False)
self.splitView.setVisible(False)
self.searchBar.setVisible(False)
# Build the Tree View
@@ -516,9 +510,9 @@ class GuiMain(QMainWindow):
self.tabWidget.setCurrentWidget(self.splitDocs)
if self.docViewer.loadText(tHandle):
if not self.viewPane.isVisible():
if not self.splitView.isVisible():
bPos = self.splitMain.sizes()
self.viewPane.setVisible(True)
self.splitView.setVisible(True)
vPos = [0, 0]
vPos[0] = int(bPos[1]/2)
vPos[1] = bPos[1] - vPos[0]
@@ -882,13 +876,15 @@ class GuiMain(QMainWindow):
return
def closeDocViewer(self):
"""Close the document view panel.
"""
self.docViewer.clearViewer()
self.theProject.setLastViewed(None)
bPos = self.splitMain.sizes()
self.viewPane.setVisible(False)
self.splitView.setVisible(False)
vPos = [bPos[1], 0]
self.splitDocs.setSizes(vPos)
return not self.viewPane.isVisible()
return not self.splitView.isVisible()
def toggleZenMode(self):
"""Main GUI Zen Mode hides tree, view pane and optionally also
@@ -911,10 +907,10 @@ class GuiMain(QMainWindow):
self.mainMenu.setVisible(isVisible)
self.tabWidget.tabBar().setVisible(isVisible)
if self.viewPane.isVisible():
self.viewPane.setVisible(False)
if self.splitView.isVisible():
self.splitView.setVisible(False)
elif self.docViewer.theHandle is not None:
self.viewPane.setVisible(True)
self.splitView.setVisible(True)
return True