Renamed the typewriter config settings

This commit is contained in:
Veronica K. B. Olsen
2020-10-18 19:37:32 +02:00
parent 8e222c1e67
commit dc4257bbf4
7 changed files with 48 additions and 43 deletions
+2 -2
View File
@@ -778,7 +778,7 @@ class GuiDocEditor(QTextEdit):
self.docAction(nwDocAction.SEL_ALL)
return
if self.mainConf.scollWithCursor:
if self.mainConf.autoScroll:
cOld = self.cursorRect().center().y()
QTextEdit.keyPressEvent(self, keyEvent)
@@ -789,7 +789,7 @@ class GuiDocEditor(QTextEdit):
if okMod and okKey:
cNew = self.cursorRect().center().y()
cMov = cNew - cOld
mPos = self.mainConf.scollToPoint * self.viewport().height() * 0.01
mPos = self.mainConf.autoScrollPos * self.viewport().height() * 0.01
if abs(cMov) > 0 and cOld > mPos:
# Move the scroll bar
vBar = self.verticalScrollBar()
+14 -14
View File
@@ -569,23 +569,23 @@ class GuiConfigEditLayoutTab(QWidget):
)
## Typewriter Scrolling
self.scollWithCursor = QSwitch()
self.scollWithCursor.setChecked(self.mainConf.scollWithCursor)
self.autoScroll = QSwitch()
self.autoScroll.setChecked(self.mainConf.autoScroll)
self.mainForm.addRow(
"Typewriter style scrolling when you type",
self.scollWithCursor,
self.autoScroll,
"Tries to keep the cursor at a fixed vertical position."
)
## Font Size
self.scollToPoint = QSpinBox(self)
self.scollToPoint.setMinimum(10)
self.scollToPoint.setMaximum(90)
self.scollToPoint.setSingleStep(1)
self.scollToPoint.setValue(self.mainConf.scollToPoint)
self.autoScrollPos = QSpinBox(self)
self.autoScrollPos.setMinimum(10)
self.autoScrollPos.setMaximum(90)
self.autoScrollPos.setSingleStep(1)
self.autoScrollPos.setValue(int(self.mainConf.autoScrollPos))
self.mainForm.addRow(
"Position in the editor to keep the cursor",
self.scollToPoint,
"Minimum position for Typewriter scrolling",
self.autoScrollPos,
"In units of percentage of the editor height.",
theUnit = "%"
)
@@ -608,8 +608,8 @@ class GuiConfigEditLayoutTab(QWidget):
textMargin = self.textMargin.value()
tabWidth = self.tabWidth.value()
scrollPastEnd = self.scrollPastEnd.isChecked()
scollWithCursor = self.scollWithCursor.isChecked()
scollToPoint = self.scollToPoint.value()
autoScroll = self.autoScroll.isChecked()
autoScrollPos = self.autoScrollPos.value()
self.mainConf.textFont = textFont
self.mainConf.textSize = textSize
@@ -621,8 +621,8 @@ class GuiConfigEditLayoutTab(QWidget):
self.mainConf.textMargin = textMargin
self.mainConf.tabWidth = tabWidth
self.mainConf.scrollPastEnd = scrollPastEnd
self.mainConf.scollWithCursor = scollWithCursor
self.mainConf.scollToPoint = scollToPoint
self.mainConf.autoScroll = autoScroll
self.mainConf.autoScrollPos = autoScrollPos
self.mainConf.confChanged = True