Skip to content

Commit

Permalink
Merge pull request sqlitebrowser#365 from SevenLines/sevenlines
Browse files Browse the repository at this point in the history
fix: UTF-8 characters (when out of comments or quotes) are drawn with different font
  • Loading branch information
justinclift committed Jul 1, 2015
2 parents 25d3db8 + 3b5053c commit 3343345
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sqltextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void SqlTextEdit::updateLineNumberAreaWidth()

// Calculate the width of this number if it was all zeros (this is because a 1 might require less space than a 0 and this could
// cause some flickering depending on the font) and set the new margin width.
QFont font = lexer()->defaultFont(QsciLexerSQL::Default);
QFont font = lexer()->font(QsciLexerSQL::Default);
setMarginWidth(0, QFontMetrics(font).width(QString("0").repeated(digits)) + 5);
}

Expand Down Expand Up @@ -104,11 +104,11 @@ void SqlTextEdit::reloadKeywords()
void SqlTextEdit::reloadSettings()
{
// Set syntax highlighting settings
sqlLexer->setDefaultColor(Qt::black);
QFont defaultfont(PreferencesDialog::getSettingsValue("editor", "font").toString());
defaultfont.setStyleHint(QFont::TypeWriter);
defaultfont.setPointSize(PreferencesDialog::getSettingsValue("editor", "fontsize").toInt());
sqlLexer->setDefaultFont(defaultfont);
sqlLexer->setColor(Qt::black, QsciLexerSQL::Default);
sqlLexer->setFont(defaultfont);
setupSyntaxHighlightingFormat("comment", QsciLexerSQL::Comment);
setupSyntaxHighlightingFormat("comment", QsciLexerSQL::CommentLine);
setupSyntaxHighlightingFormat("comment", QsciLexerSQL::CommentDoc);
Expand Down

0 comments on commit 3343345

Please sign in to comment.