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.autoScroll = False # Typewriter-like scrolling
|
||||||
self.autoScrollPos = 30 # Start point for 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.wordCountTimer = 5.0 # Interval for word count update in seconds
|
||||||
self.incNotesWCount = True # The status bar word count includes notes
|
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.doReplaceDots = conf.rdBool(sec, "repdots", self.doReplaceDots)
|
||||||
self.autoScroll = conf.rdBool(sec, "autoscroll", self.autoScroll)
|
self.autoScroll = conf.rdBool(sec, "autoscroll", self.autoScroll)
|
||||||
self.autoScrollPos = conf.rdInt(sec, "autoscrollpos", self.autoScrollPos)
|
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.fmtSQuoteOpen = conf.rdStr(sec, "fmtsquoteopen", self.fmtSQuoteOpen)
|
||||||
self.fmtSQuoteClose = conf.rdStr(sec, "fmtsquoteclose", self.fmtSQuoteClose)
|
self.fmtSQuoteClose = conf.rdStr(sec, "fmtsquoteclose", self.fmtSQuoteClose)
|
||||||
self.fmtDQuoteOpen = conf.rdStr(sec, "fmtdquoteopen", self.fmtDQuoteOpen)
|
self.fmtDQuoteOpen = conf.rdStr(sec, "fmtdquoteopen", self.fmtDQuoteOpen)
|
||||||
@@ -701,6 +703,7 @@ class Config:
|
|||||||
"repdots": str(self.doReplaceDots),
|
"repdots": str(self.doReplaceDots),
|
||||||
"autoscroll": str(self.autoScroll),
|
"autoscroll": str(self.autoScroll),
|
||||||
"autoscrollpos": str(self.autoScrollPos),
|
"autoscrollpos": str(self.autoScrollPos),
|
||||||
|
"scrollpastend": str(self.scrollPastEnd),
|
||||||
"fmtsquoteopen": str(self.fmtSQuoteOpen),
|
"fmtsquoteopen": str(self.fmtSQuoteOpen),
|
||||||
"fmtsquoteclose": str(self.fmtSQuoteClose),
|
"fmtsquoteclose": str(self.fmtSQuoteClose),
|
||||||
"fmtdquoteopen": str(self.fmtDQuoteOpen),
|
"fmtdquoteopen": str(self.fmtDQuoteOpen),
|
||||||
|
|||||||
@@ -726,6 +726,15 @@ class GuiPreferencesEditor(QWidget):
|
|||||||
# ================
|
# ================
|
||||||
self.mainForm.addGroupLabel(self.tr("Scroll Behaviour"))
|
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
|
# Typewriter Scrolling
|
||||||
self.autoScroll = NSwitch()
|
self.autoScroll = NSwitch()
|
||||||
self.autoScroll.setChecked(CONFIG.autoScroll)
|
self.autoScroll.setChecked(CONFIG.autoScroll)
|
||||||
@@ -766,6 +775,7 @@ class GuiPreferencesEditor(QWidget):
|
|||||||
# Scroll Behaviour
|
# Scroll Behaviour
|
||||||
CONFIG.autoScroll = self.autoScroll.isChecked()
|
CONFIG.autoScroll = self.autoScroll.isChecked()
|
||||||
CONFIG.autoScrollPos = self.autoScrollPos.value()
|
CONFIG.autoScrollPos = self.autoScrollPos.value()
|
||||||
|
CONFIG.scrollPastEnd = self.scrollPastEnd.isChecked()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ class GuiDocEditor(QPlainTextEdit):
|
|||||||
self.setMinimumWidth(CONFIG.pxInt(300))
|
self.setMinimumWidth(CONFIG.pxInt(300))
|
||||||
self.setAutoFillBackground(True)
|
self.setAutoFillBackground(True)
|
||||||
self.setFrameStyle(QFrame.NoFrame)
|
self.setFrameStyle(QFrame.NoFrame)
|
||||||
self.setCenterOnScroll(True)
|
|
||||||
|
|
||||||
# Custom Shortcuts
|
# Custom Shortcuts
|
||||||
self.keyContext = QShortcut(self)
|
self.keyContext = QShortcut(self)
|
||||||
@@ -342,7 +341,8 @@ class GuiDocEditor(QPlainTextEdit):
|
|||||||
|
|
||||||
self._qDocument.setDefaultTextOption(options)
|
self._qDocument.setDefaultTextOption(options)
|
||||||
|
|
||||||
# Scroll bars
|
# Scrolling
|
||||||
|
self.setCenterOnScroll(CONFIG.scrollPastEnd)
|
||||||
if CONFIG.hideVScroll:
|
if CONFIG.hideVScroll:
|
||||||
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user