Added more comments and tweaked the scroll features

This commit is contained in:
Veronica K. B. Olsen
2020-10-18 19:56:24 +02:00
parent dc4257bbf4
commit eed349ab85
2 changed files with 37 additions and 30 deletions
+35 -27
View File
@@ -107,44 +107,52 @@ class Config:
self.hideHScroll = False # Hide horizontal scroll bars on main widgets
## Project
self.autoSaveProj = 60
self.autoSaveDoc = 30
self.autoSaveProj = 60 # Interval for auto-saving project in seconds
self.autoSaveDoc = 30 # Interval for auto-saving document in seconds
## Text Editor
self.textFont = None
self.textSize = 12
self.textFixedW = True
self.textWidth = 600
self.textMargin = 40
self.tabWidth = 40
self.focusWidth = 800
self.hideFocusFooter = False
self.doJustify = False
self.autoSelect = True
self.doReplace = True
self.doReplaceSQuote = True
self.doReplaceDQuote = True
self.doReplaceDash = True
self.doReplaceDots = True
self.scrollPastEnd = True
self.autoScroll = False
self.autoScrollPos = 30
self.textFont = None # Editor font
self.textSize = 12 # Editor font size
self.textFixedW = True # Keep editor text fixed width
self.textWidth = 600 # Editor text width
self.textMargin = 40 # Editor/viewer text margin
self.tabWidth = 40 # Editor tabulator width
self.wordCountTimer = 5.0
self.showTabsNSpaces = False
self.showLineEndings = False
self.bigDocLimit = 800
self.showFullPath = True
self.highlightQuotes = True
self.highlightEmph = True
self.focusWidth = 800 # Focus Mode text width
self.hideFocusFooter = False # Hide document footer in Focus Mode
self.showFullPath = True # Show full document path in editor header
self.autoSelect = True # Auto-select word when applying format with no selection
self.doJustify = False # Justify text
self.showTabsNSpaces = False # Show tabs and spaces in edior
self.showLineEndings = False # Show line endings in editor
self.doReplace = True # Enable auto-replace as you type
self.doReplaceSQuote = True # Smart single quotes
self.doReplaceDQuote = True # Smart double quotes
self.doReplaceDash = True # Replace multiple hyphens with dashes
self.doReplaceDots = True # Replace three dots with ellipsis
self.scrollPastEnd = True # Allow scrolling past end of document
self.autoScroll = False # Typewriter-like scrolling
self.autoScrollPos = 30 # Start point for typewriter-like scrolling
self.wordCountTimer = 5.0 # Interval for word count update in seconds
self.bigDocLimit = 800 # Size threshold for heavy editor features in kilobytes
self.highlightQuotes = True # Highlight text in quotes
self.highlightEmph = True # Add colour to text emphasis
## User-Selected Symbols
self.fmtApostrophe = nwUnicode.U_RSQUO
self.fmtSingleQuotes = [nwUnicode.U_LSQUO, nwUnicode.U_RSQUO]
self.fmtDoubleQuotes = [nwUnicode.U_LDQUO, nwUnicode.U_RDQUO]
## Spell Checking
self.spellTool = None
self.spellLanguage = None
## Search Bar Switches
self.searchCase = False
self.searchWord = False
self.searchRegEx = False
+2 -3
View File
@@ -441,8 +441,7 @@ class GuiDocEditor(QTextEdit):
if self.mainConf.scrollPastEnd:
docFrame = self.qDocument.rootFrame().frameFormat()
docMargin = wH - uM - lM - 4*tB - 5*self.theTheme.fontPixelSize
docFrame.setBottomMargin(max(0, docMargin))
docFrame.setBottomMargin(max(0, 0.6*(wH - uM - lM - 4*tB)))
self.qDocument.rootFrame().setFrameFormat(docFrame)
return
@@ -794,7 +793,7 @@ class GuiDocEditor(QTextEdit):
# Move the scroll bar
vBar = self.verticalScrollBar()
doAnim = QPropertyAnimation(vBar, b"value", self)
doAnim.setDuration(150)
doAnim.setDuration(120)
doAnim.setStartValue(vBar.value())
doAnim.setEndValue(vBar.value() + cMov)
doAnim.start()