Remove scaling and add slots to main config class
This commit is contained in:
@@ -331,7 +331,7 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
# Due to cursor visibility, a part of the margin must be
|
||||
# allocated to the document itself. See issue #1112.
|
||||
self._qDocument.setDocumentMargin(4)
|
||||
self._vpMargin = max(CONFIG.getTextMargin() - 4, 0)
|
||||
self._vpMargin = max(CONFIG.textMargin - 4, 0)
|
||||
self.setViewportMargins(self._vpMargin, self._vpMargin, self._vpMargin, self._vpMargin)
|
||||
|
||||
# Also set the document text options for the document text flow
|
||||
@@ -359,7 +359,7 @@ class GuiDocEditor(QPlainTextEdit):
|
||||
self.setHorizontalScrollBarPolicy(QtScrollAsNeeded)
|
||||
|
||||
# Refresh the tab stops
|
||||
self.setTabStopDistance(CONFIG.getTabWidth())
|
||||
self.setTabStopDistance(CONFIG.tabWidth)
|
||||
|
||||
# If we have a document open, we should refresh it in case the
|
||||
# font changed, otherwise we just clear the editor entirely,
|
||||
|
||||
@@ -200,7 +200,7 @@ class GuiDocViewer(QTextBrowser):
|
||||
self.setHorizontalScrollBarPolicy(QtScrollAsNeeded)
|
||||
|
||||
# Refresh the tab stops
|
||||
self.setTabStopDistance(CONFIG.getTabWidth())
|
||||
self.setTabStopDistance(CONFIG.tabWidth)
|
||||
|
||||
# If we have a document open, we should reload it in case the font changed
|
||||
self.reloadText()
|
||||
@@ -250,7 +250,7 @@ class GuiDocViewer(QTextBrowser):
|
||||
|
||||
self.setDocumentTitle(tHandle)
|
||||
self.setDocument(qDoc.document)
|
||||
self.setTabStopDistance(CONFIG.getTabWidth())
|
||||
self.setTabStopDistance(CONFIG.tabWidth)
|
||||
|
||||
if self._docHandle == tHandle:
|
||||
# This is a refresh, so we set the scrollbar back to where it was
|
||||
@@ -308,7 +308,7 @@ class GuiDocViewer(QTextBrowser):
|
||||
"""Automatically adjust the margins so the text is centred."""
|
||||
wW = self.width()
|
||||
wH = self.height()
|
||||
cM = CONFIG.getTextMargin()
|
||||
cM = CONFIG.textMargin
|
||||
|
||||
vBar = self.verticalScrollBar()
|
||||
sW = vBar.width() if vBar.isVisible() else 0
|
||||
|
||||
Reference in New Issue
Block a user