Skip to content
Permalink
Browse files

Use Python editor font and size for code editor

  • Loading branch information
NathanW2 committed Feb 5, 2015
1 parent 9de6ae9 commit f6d6c69bb1c616ffdf21d1f948a8d17f6df49e46
Showing with 10 additions and 20 deletions.
  1. +10 −19 src/gui/qgscodeeditor.cpp
  2. +0 −1 src/gui/qgscodeeditorpython.cpp
@@ -131,25 +131,16 @@ bool QgsCodeEditor::isFixedPitch( const QFont& font )

QFont QgsCodeEditor::getMonospaceFont()
{
QFont font( "monospace" );
if ( isFixedPitch( font ) )
{
return font;
}
font.setStyleHint( QFont::Monospace );
if ( isFixedPitch( font ) )
{
return font;
}
QSettings settings;
QString loadFont = settings.value( "pythonConsole/fontfamilytextEditor", "Monospace" ).toString();
int fontSize = settings.value( "pythonConsole/fontsizeEditor", 10 ).toInt();

QFont font( loadFont );
font.setFixedPitch( true );
font.setPointSize( fontSize );
font.setStyleHint( QFont::TypeWriter );
if ( isFixedPitch( font ) )
{
return font;
}
font.setFamily( "courier" );
if ( isFixedPitch( font ) )
{
return font;
}
font.setStretch( QFont::SemiCondensed );
font.setLetterSpacing( QFont::PercentageSpacing, 87.0 );
font.setBold( false );
return font;
}
@@ -52,7 +52,6 @@ void QgsCodeEditorPython::setSciLexerPython()
setWhitespaceVisibility( QsciScintilla::WsVisibleAfterIndent );

QFont font = getMonospaceFont();
font.setPointSize( 10 );

QsciLexerPython* pyLexer = new QsciLexerPython();
pyLexer->setDefaultFont( font );

0 comments on commit f6d6c69

Please sign in to comment.
You can’t perform that action at this time.