Add back the scroll past end setting
This commit is contained in:
@@ -148,6 +148,7 @@ class Config:
|
||||
|
||||
self.autoScroll = False # Typewriter-like scrolling
|
||||
self.autoScrollPos = 30 # Start point for typewriter-like scrolling
|
||||
self.scrollPastEnd = True # Scroll past end of document, and centre cursor
|
||||
|
||||
self.wordCountTimer = 5.0 # Interval for word count update in seconds
|
||||
self.incNotesWCount = True # The status bar word count includes notes
|
||||
@@ -577,6 +578,7 @@ class Config:
|
||||
self.doReplaceDots = conf.rdBool(sec, "repdots", self.doReplaceDots)
|
||||
self.autoScroll = conf.rdBool(sec, "autoscroll", self.autoScroll)
|
||||
self.autoScrollPos = conf.rdInt(sec, "autoscrollpos", self.autoScrollPos)
|
||||
self.scrollPastEnd = conf.rdBool(sec, "scrollpastend", self.scrollPastEnd)
|
||||
self.fmtSQuoteOpen = conf.rdStr(sec, "fmtsquoteopen", self.fmtSQuoteOpen)
|
||||
self.fmtSQuoteClose = conf.rdStr(sec, "fmtsquoteclose", self.fmtSQuoteClose)
|
||||
self.fmtDQuoteOpen = conf.rdStr(sec, "fmtdquoteopen", self.fmtDQuoteOpen)
|
||||
@@ -701,6 +703,7 @@ class Config:
|
||||
"repdots": str(self.doReplaceDots),
|
||||
"autoscroll": str(self.autoScroll),
|
||||
"autoscrollpos": str(self.autoScrollPos),
|
||||
"scrollpastend": str(self.scrollPastEnd),
|
||||
"fmtsquoteopen": str(self.fmtSQuoteOpen),
|
||||
"fmtsquoteclose": str(self.fmtSQuoteClose),
|
||||
"fmtdquoteopen": str(self.fmtDQuoteOpen),
|
||||
|
||||
@@ -726,6 +726,15 @@ class GuiPreferencesEditor(QWidget):
|
||||
# ================
|
||||
self.mainForm.addGroupLabel(self.tr("Scroll Behaviour"))
|
||||
|
||||
# Scroll Past End
|
||||
self.scrollPastEnd = NSwitch()
|
||||
self.scrollPastEnd.setChecked(CONFIG.scrollPastEnd)
|
||||
self.mainForm.addRow(
|
||||
self.tr("Scroll past end of the document"),
|
||||
self.scrollPastEnd,
|
||||
self.tr("Also centres the cursor when scrolling.")
|
||||
)
|
||||
|
||||
# Typewriter Scrolling
|
||||
self.autoScroll = NSwitch()
|
||||
self.autoScroll.setChecked(CONFIG.autoScroll)
|
||||
@@ -766,6 +775,7 @@ class GuiPreferencesEditor(QWidget):
|
||||
# Scroll Behaviour
|
||||
CONFIG.autoScroll = self.autoScroll.isChecked()
|
||||
CONFIG.autoScrollPos = self.autoScrollPos.value()
|
||||
CONFIG.scrollPastEnd = self.scrollPastEnd.isChecked()
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -164,7 +164,6 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
self.setMinimumWidth(CONFIG.pxInt(300))
|
||||
self.setAutoFillBackground(True)
|
||||
self.setFrameStyle(QFrame.NoFrame)
|
||||
self.setCenterOnScroll(True)
|
||||
|
||||
# Custom Shortcuts
|
||||
self.keyContext = QShortcut(self)
|
||||
@@ -342,7 +341,8 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
|
||||
self._qDocument.setDefaultTextOption(options)
|
||||
|
||||
# Scroll bars
|
||||
# Scrolling
|
||||
self.setCenterOnScroll(CONFIG.scrollPastEnd)
|
||||
if CONFIG.hideVScroll:
|
||||
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user