Allow showing comments in document view pane, with a toggle swithc in document menu

This commit is contained in:
Veronica K. B. Olsen
2019-11-02 20:08:02 +01:00
parent a8c0608457
commit e94bdd9340
6 changed files with 46 additions and 14 deletions
+10 -5
View File
@@ -105,7 +105,7 @@ class GuiDocViewer(QTextBrowser):
logger.debug("Generating preview for item %s" % tHandle)
sPos = self.verticalScrollBar().value()
aDoc = ToHtml(self.theProject, self.theParent)
aDoc.setPreview(True)
aDoc.setPreview(True, self.mainConf.viewComments)
aDoc.setText(tHandle)
aDoc.doAutoReplace()
aDoc.tokenizeText()
@@ -121,6 +121,10 @@ class GuiDocViewer(QTextBrowser):
return True
def reloadText(self):
self.loadText(self.theHandle)
return
def loadFromTag(self, theTag):
logger.debug("Loading document from tag '%s'" % theTag)
@@ -180,10 +184,6 @@ class GuiDocViewer(QTextBrowser):
"a {{"
" color: rgb({aColR},{aColG},{aColB});"
"}}\n"
"pre {{"
" color: rgb({cColR},{cColG},{cColB});"
" font-size: {preSize:.1f}pt;"
"}}\n"
"mark {{"
" color: rgb({eColR},{eColG},{eColB});"
"}}\n"
@@ -197,6 +197,11 @@ class GuiDocViewer(QTextBrowser):
" color: rgb({kColR},{kColG},{kColB});"
" font-wright: bold;"
"}}\n"
".comment {{"
" color: rgb({cColR},{cColG},{cColB});"
" margin-left: 1em;"
" margin-right: 1em;"
"}}\n"
).format(
textSize = self.mainConf.textSize,
preSize = self.mainConf.textSize*0.9,