Added more comments and tweaked the scroll features
This commit is contained in:
+35
-27
@@ -107,44 +107,52 @@ class Config:
|
|||||||
self.hideHScroll = False # Hide horizontal scroll bars on main widgets
|
self.hideHScroll = False # Hide horizontal scroll bars on main widgets
|
||||||
|
|
||||||
## Project
|
## Project
|
||||||
self.autoSaveProj = 60
|
self.autoSaveProj = 60 # Interval for auto-saving project in seconds
|
||||||
self.autoSaveDoc = 30
|
self.autoSaveDoc = 30 # Interval for auto-saving document in seconds
|
||||||
|
|
||||||
## Text Editor
|
## Text Editor
|
||||||
self.textFont = None
|
self.textFont = None # Editor font
|
||||||
self.textSize = 12
|
self.textSize = 12 # Editor font size
|
||||||
self.textFixedW = True
|
self.textFixedW = True # Keep editor text fixed width
|
||||||
self.textWidth = 600
|
self.textWidth = 600 # Editor text width
|
||||||
self.textMargin = 40
|
self.textMargin = 40 # Editor/viewer text margin
|
||||||
self.tabWidth = 40
|
self.tabWidth = 40 # Editor tabulator width
|
||||||
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.wordCountTimer = 5.0
|
self.focusWidth = 800 # Focus Mode text width
|
||||||
self.showTabsNSpaces = False
|
self.hideFocusFooter = False # Hide document footer in Focus Mode
|
||||||
self.showLineEndings = False
|
self.showFullPath = True # Show full document path in editor header
|
||||||
self.bigDocLimit = 800
|
self.autoSelect = True # Auto-select word when applying format with no selection
|
||||||
self.showFullPath = True
|
|
||||||
self.highlightQuotes = True
|
|
||||||
self.highlightEmph = True
|
|
||||||
|
|
||||||
|
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.fmtApostrophe = nwUnicode.U_RSQUO
|
||||||
self.fmtSingleQuotes = [nwUnicode.U_LSQUO, nwUnicode.U_RSQUO]
|
self.fmtSingleQuotes = [nwUnicode.U_LSQUO, nwUnicode.U_RSQUO]
|
||||||
self.fmtDoubleQuotes = [nwUnicode.U_LDQUO, nwUnicode.U_RDQUO]
|
self.fmtDoubleQuotes = [nwUnicode.U_LDQUO, nwUnicode.U_RDQUO]
|
||||||
|
|
||||||
|
## Spell Checking
|
||||||
self.spellTool = None
|
self.spellTool = None
|
||||||
self.spellLanguage = None
|
self.spellLanguage = None
|
||||||
|
|
||||||
|
## Search Bar Switches
|
||||||
self.searchCase = False
|
self.searchCase = False
|
||||||
self.searchWord = False
|
self.searchWord = False
|
||||||
self.searchRegEx = False
|
self.searchRegEx = False
|
||||||
|
|||||||
+2
-3
@@ -441,8 +441,7 @@ class GuiDocEditor(QTextEdit):
|
|||||||
|
|
||||||
if self.mainConf.scrollPastEnd:
|
if self.mainConf.scrollPastEnd:
|
||||||
docFrame = self.qDocument.rootFrame().frameFormat()
|
docFrame = self.qDocument.rootFrame().frameFormat()
|
||||||
docMargin = wH - uM - lM - 4*tB - 5*self.theTheme.fontPixelSize
|
docFrame.setBottomMargin(max(0, 0.6*(wH - uM - lM - 4*tB)))
|
||||||
docFrame.setBottomMargin(max(0, docMargin))
|
|
||||||
self.qDocument.rootFrame().setFrameFormat(docFrame)
|
self.qDocument.rootFrame().setFrameFormat(docFrame)
|
||||||
|
|
||||||
return
|
return
|
||||||
@@ -794,7 +793,7 @@ class GuiDocEditor(QTextEdit):
|
|||||||
# Move the scroll bar
|
# Move the scroll bar
|
||||||
vBar = self.verticalScrollBar()
|
vBar = self.verticalScrollBar()
|
||||||
doAnim = QPropertyAnimation(vBar, b"value", self)
|
doAnim = QPropertyAnimation(vBar, b"value", self)
|
||||||
doAnim.setDuration(150)
|
doAnim.setDuration(120)
|
||||||
doAnim.setStartValue(vBar.value())
|
doAnim.setStartValue(vBar.value())
|
||||||
doAnim.setEndValue(vBar.value() + cMov)
|
doAnim.setEndValue(vBar.value() + cMov)
|
||||||
doAnim.start()
|
doAnim.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user