Merge branch 'dev' into view_details

This commit is contained in:
Veronica K. B. Olsen
2020-05-27 20:22:54 +02:00
19 changed files with 394 additions and 160 deletions
+10 -4
View File
@@ -85,7 +85,8 @@ class GuiDocEditor(QTextEdit):
# Document Title
self.docTitle = GuiDocTitleBar(self, self.theProject)
self.docTitle.setGeometry(0,0,self.docTitle.width(),self.docTitle.height())
self.docTitle.setGeometry(0, 0, self.docTitle.width(), self.docTitle.height())
self.setViewportMargins(0, self.docTitle.height(), 0, 0)
# Syntax
self.hLight = GuiDocHighlighter(self.qDocument, self.theParent)
@@ -227,7 +228,6 @@ class GuiDocEditor(QTextEdit):
tHandle = self.theHandle
self.clearEditor()
self.loadText(tHandle, showStatus=False)
self.updateDocMargins()
return
def loadText(self, tHandle, tLine=None, showStatus=True):
@@ -288,6 +288,7 @@ class GuiDocEditor(QTextEdit):
"""
self.setPlainText(theText)
self.setDocumentChanged(True)
self.updateDocMargins()
return
def saveText(self):
@@ -336,13 +337,17 @@ class GuiDocEditor(QTextEdit):
tB = self.lineWidth()
tW = self.width() - 2*tB
tH = self.docTitle.height()
tT = self.mainConf.textMargin - tH
self.docTitle.setGeometry(tB, tB, tW, tH)
self.setViewportMargins(0, tH, 0, 0)
docFormat = self.qDocument.rootFrame().frameFormat()
docFormat.setLeftMargin(tM)
docFormat.setRightMargin(tM)
if docFormat.topMargin() < tH:
docFormat.setTopMargin(tH + 2)
if tT > 0:
docFormat.setTopMargin(tT)
else:
docFormat.setTopMargin(0)
# Updating root frame triggers a QTextDocument->contentsChange
# signal, which we do not want as it re-runs the syntax
@@ -365,6 +370,7 @@ class GuiDocEditor(QTextEdit):
"""
if tHandle == self.theHandle:
self.docTitle.setTitleFromHandle(self.theHandle)
self.updateDocMargins()
return
##