Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ui][html code editor] use monospace font
(cherry-picked from 845e87a)
  • Loading branch information
nirvn authored and nyalldawson committed Jul 24, 2018
1 parent b3879cf commit a565b4c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gui/qgscodeeditorhtml.cpp
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 a565b4c

Please sign in to comment.