Fixes FullScreenEditor with MDEditView

This commit is contained in:
Olivier Keshavjee 2017-11-27 21:13:15 +01:00
parent 7b29d332c5
commit 9baea11791
3 changed files with 11 additions and 4 deletions

View file

@ -64,7 +64,10 @@ class BasicHighlighter(QSyntaxHighlighter):
else:
opt = self.editor._themeData
self.defaultTextColor = QColor(opt["Text/Color"])
self.backgroundColor = QColor(opt["Background/Color"])
self.backgroundColor = F.mixColors(
QColor(opt["Foreground/Color"]),
QColor(opt["Background/Color"]),
int(opt["Foreground/Opacity"])/100.)
self.markupColor = F.mixColors(self.defaultTextColor,
self.backgroundColor,
.3)

View file

@ -24,6 +24,10 @@ class MDEditView(textEditView):
self._textFormat = "md"
self._highlighterClass = MarkdownHighlighter
if index:
# We have to setup things anew, for the highlighter notably
self.setCurrentModelIndex(index)
# def focusInEvent(self, event):
# """Finds textFormatter and attach them to that view."""
# textEditView.focusInEvent(self, event)

View file

@ -83,9 +83,9 @@ class textEditView(QTextEdit):
else:
self.spellcheck = False
# if self._highlighting and not self.highlighter:
# self.highlighter = self._highlighterClass(self)
# self.highlighter.setDefaultBlockFormat(self._defaultBlockFormat)
if self._highlighting and not self.highlighter:
self.highlighter = self._highlighterClass(self)
self.highlighter.setDefaultBlockFormat(self._defaultBlockFormat)
def getDefaultLocale(self):
default_locale = enchant.get_default_language()