Using scrollarea for the viewer reference panel

This commit is contained in:
Veronica K. B. Olsen
2019-10-31 22:55:52 +01:00
parent c4e090b5eb
commit 18f45c5e11
2 changed files with 11 additions and 3 deletions
+10 -3
View File
@@ -15,7 +15,7 @@ import nw
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QWidget, QHBoxLayout, QLabel, QGroupBox from PyQt5.QtWidgets import QWidget, QHBoxLayout, QLabel, QGroupBox, QScrollArea, QFrame
from nw.constants import nwLabels from nw.constants import nwLabels
@@ -45,7 +45,14 @@ class GuiDocViewDetails(QWidget):
self.refList.setScaledContents(True) self.refList.setScaledContents(True)
self.refList.linkActivated.connect(self._linkClicked) self.refList.linkActivated.connect(self._linkClicked)
self.refTagsForm.addWidget(self.refList) self.scrollBox = QScrollArea()
self.scrollBox.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scrollBox.setFrameStyle(QFrame.NoFrame)
self.scrollBox.setWidgetResizable(True)
self.scrollBox.setMaximumHeight(300)
self.scrollBox.setWidget(self.refList)
self.refTagsForm.addWidget(self.scrollBox)
self.outerBox.addWidget(self.refTags) self.outerBox.addWidget(self.refTags)
self.setLayout(self.outerBox) self.setLayout(self.outerBox)
self.setContentsMargins(0,0,0,0) self.setContentsMargins(0,0,0,0)
@@ -70,7 +77,7 @@ class GuiDocViewDetails(QWidget):
theList.append("<a href='#tag=%s'>%s</a>" % (tHandle,tItem.itemName)) theList.append("<a href='#tag=%s'>%s</a>" % (tHandle,tItem.itemName))
self.refList.setText(", ".join(theList)) self.refList.setText(", ".join(theList))
self.refList.setMaximumHeight(300) self.refList.adjustSize()
return return
+1
View File
@@ -108,6 +108,7 @@ class GuiMain(QMainWindow):
self.docView.setContentsMargins(0,0,0,0) self.docView.setContentsMargins(0,0,0,0)
self.docView.addWidget(self.docViewer) self.docView.addWidget(self.docViewer)
self.docView.addWidget(self.docMeta) self.docView.addWidget(self.docMeta)
self.docView.setStretch(0, 1)
self.viewPane.setLayout(self.docView) self.viewPane.setLayout(self.docView)
self.splitView = QSplitter(Qt.Horizontal) self.splitView = QSplitter(Qt.Horizontal)