mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-30 07:50:42 -06:00
Restore correct font after the Cell Edit dock is set to plain text
QScintilla seems to reset many settings when setLexer is called, so we need to restore the font when switching from the lexer modes to the mode without lexer (plain text). See issue #1793.
This commit is contained in:
@@ -36,9 +36,9 @@ void DockTextEdit::reloadSettings()
|
||||
reloadLexerSettings(xmlLexer);
|
||||
|
||||
// Set the databrowser font for the plain text editor.
|
||||
QFont textFont(Settings::getValue("databrowser", "font").toString());
|
||||
textFont.setPointSize(Settings::getValue("databrowser", "fontsize").toInt());
|
||||
setFont(textFont);
|
||||
plainTextFont = QFont(Settings::getValue("databrowser", "font").toString());
|
||||
plainTextFont.setPointSize(Settings::getValue("databrowser", "fontsize").toInt());
|
||||
setFont(plainTextFont);
|
||||
|
||||
setupSyntaxHighlightingFormat(jsonLexer, "comment", QsciLexerJSON::CommentLine);
|
||||
setupSyntaxHighlightingFormat(jsonLexer, "comment", QsciLexerJSON::CommentBlock);
|
||||
@@ -84,6 +84,8 @@ void DockTextEdit::setLanguage(Language lang)
|
||||
case PlainText: {
|
||||
setLexer(nullptr);
|
||||
setFolding(QsciScintilla::NoFoldStyle);
|
||||
// This appears to be reset by setLexer
|
||||
setFont(plainTextFont);
|
||||
break;
|
||||
}
|
||||
case JSON:
|
||||
|
||||
@@ -42,6 +42,7 @@ protected:
|
||||
static QsciLexerXML* xmlLexer;
|
||||
private:
|
||||
Language m_language;
|
||||
QFont plainTextFont;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user