Make both panes use viewportmargin
This commit is contained in:
@@ -351,7 +351,6 @@ class GuiDocEditor(QTextEdit):
|
|||||||
else:
|
else:
|
||||||
rH = 0
|
rH = 0
|
||||||
|
|
||||||
# print(tM, tH, rH, max(tM, tH, rH))
|
|
||||||
self.setViewportMargins(tM, max(cM, tH, rH), tM, cM)
|
self.setViewportMargins(tM, max(cM, tH, rH), tM, cM)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
+5
-12
@@ -60,6 +60,7 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
|
|
||||||
self.qDocument = self.document()
|
self.qDocument = self.document()
|
||||||
self.setMinimumWidth(self.mainConf.pxInt(300))
|
self.setMinimumWidth(self.mainConf.pxInt(300))
|
||||||
|
self.setAutoFillBackground(True)
|
||||||
self.setOpenExternalLinks(False)
|
self.setOpenExternalLinks(False)
|
||||||
self.initViewer()
|
self.initViewer()
|
||||||
|
|
||||||
@@ -104,11 +105,12 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
self.setFont(theFont)
|
self.setFont(theFont)
|
||||||
|
|
||||||
docPalette = self.palette()
|
docPalette = self.palette()
|
||||||
|
docPalette.setColor(QPalette.Window, QColor(*self.theTheme.colBack))
|
||||||
docPalette.setColor(QPalette.Base, QColor(*self.theTheme.colBack))
|
docPalette.setColor(QPalette.Base, QColor(*self.theTheme.colBack))
|
||||||
docPalette.setColor(QPalette.Text, QColor(*self.theTheme.colText))
|
docPalette.setColor(QPalette.Text, QColor(*self.theTheme.colText))
|
||||||
self.setPalette(docPalette)
|
self.setPalette(docPalette)
|
||||||
|
|
||||||
self.qDocument.setDocumentMargin(self.mainConf.getTextMargin())
|
self.qDocument.setDocumentMargin(0)
|
||||||
theOpt = QTextOption()
|
theOpt = QTextOption()
|
||||||
if self.mainConf.doJustify:
|
if self.mainConf.doJustify:
|
||||||
theOpt.setAlignment(Qt.AlignJustify)
|
theOpt.setAlignment(Qt.AlignJustify)
|
||||||
@@ -242,19 +244,10 @@ class GuiDocViewer(QTextBrowser):
|
|||||||
tH = self.docHeader.height()
|
tH = self.docHeader.height()
|
||||||
fH = self.docFooter.height()
|
fH = self.docFooter.height()
|
||||||
fY = self.height() - fH - tB
|
fY = self.height() - fH - tB
|
||||||
tT = cM - tH
|
|
||||||
bT = cM - fH
|
|
||||||
self.docHeader.setGeometry(tB, tB, tW, tH)
|
self.docHeader.setGeometry(tB, tB, tW, tH)
|
||||||
self.docFooter.setGeometry(tB, fY, tW, fH)
|
self.docFooter.setGeometry(tB, fY, tW, fH)
|
||||||
self.setViewportMargins(0, tH, 0, fH)
|
self.setViewportMargins(cM, max(cM, tH), cM, max(cM, fH))
|
||||||
|
|
||||||
docFormat = self.qDocument.rootFrame().frameFormat()
|
|
||||||
docFormat.setTopMargin(max(0, tT))
|
|
||||||
docFormat.setBottomMargin(max(0, bT))
|
|
||||||
|
|
||||||
self.qDocument.blockSignals(True)
|
|
||||||
self.qDocument.rootFrame().setFrameFormat(docFormat)
|
|
||||||
self.qDocument.blockSignals(False)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user