Skip to content

Commit

Permalink
[ui][html code editor] use monospace font
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jul 24, 2018
1 parent a9f924f commit 845e87a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gui/qgscodeeditorhtml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ QgsCodeEditorHTML::QgsCodeEditorHTML( QWidget *parent )

void QgsCodeEditorHTML::setSciLexerHTML()
{
QsciLexerHTML *lexer = new QsciLexerHTML( this );
lexer->setDefaultFont( QFont( QStringLiteral( "Sans" ), 10 ) );
QFont font = getMonospaceFont();
#ifdef Q_OS_MAC
// The font size gotten from getMonospaceFont() is too small on Mac
font.setPointSize( QLabel().font().pointSize() );
#endif

QsciLexerHTML *lexer = new QsciLexerHTML( this );
lexer->setDefaultFont( font );
lexer->setFont( font, -1 );
setLexer( lexer );
}

0 comments on commit 845e87a

Please sign in to comment.