Added scroll past end feature by setting a large root frame margin of the document
This commit is contained in:
@@ -122,6 +122,8 @@ class Config:
|
||||
self.doReplaceDQuote = True
|
||||
self.doReplaceDash = True
|
||||
self.doReplaceDots = True
|
||||
self.extendScroll = True
|
||||
|
||||
self.wordCountTimer = 5.0
|
||||
self.showTabsNSpaces = False
|
||||
self.showLineEndings = False
|
||||
|
||||
+10
-2
@@ -377,6 +377,7 @@ class GuiDocEditor(QTextEdit):
|
||||
just ensure the margins are set correctly.
|
||||
"""
|
||||
wW = self.width()
|
||||
wH = self.height()
|
||||
cM = self.mainConf.getTextMargin()
|
||||
|
||||
vBar = self.verticalScrollBar()
|
||||
@@ -400,7 +401,7 @@ class GuiDocEditor(QTextEdit):
|
||||
tW = wW - 2*tB - sW
|
||||
tH = self.docHeader.height()
|
||||
fH = self.docFooter.height()
|
||||
fY = self.height() - fH - tB - sH
|
||||
fY = wH - fH - tB - sH
|
||||
self.docHeader.setGeometry(tB, tB, tW, tH)
|
||||
self.docFooter.setGeometry(tB, fY, tW, fH)
|
||||
|
||||
@@ -412,7 +413,14 @@ class GuiDocEditor(QTextEdit):
|
||||
else:
|
||||
rH = 0
|
||||
|
||||
self.setViewportMargins(tM, max(cM, tH, rH), tM, max(cM, fH))
|
||||
uM = max(cM, tH, rH)
|
||||
lM = max(cM, fH)
|
||||
self.setViewportMargins(tM, uM, tM, lM)
|
||||
|
||||
if self.mainConf.extendScroll:
|
||||
docFrame = self.qDocument.rootFrame().frameFormat()
|
||||
docFrame.setBottomMargin(wH - uM - lM - self.theTheme.fontPixelSize)
|
||||
self.qDocument.rootFrame().setFrameFormat(docFrame)
|
||||
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user