Some more code to base class

This commit is contained in:
Nyall Dawson 2022-10-16 14:25:54 +10:00
parent 7676789a49
commit 941adaa4a8
2 changed files with 12 additions and 12 deletions

View File

@ -172,18 +172,6 @@ class ShellScintilla(QgsCodeEditorPython):
self.sessionHistoryCleared.connect(self.on_session_history_cleared)
self.persistentHistoryCleared.connect(self.on_persistent_history_cleared)
def initializeLexer(self):
super().initializeLexer()
self.setCaretLineVisible(False)
self.setLineNumbersVisible(False) # NO linenumbers for the input line
self.setFoldingVisible(False)
# Margin 1 is used for the '>>>' prompt (console input)
self.setMarginLineNumbers(1, True)
self.setMarginWidth(1, "00000")
self.setMarginType(1, 5) # TextMarginRightJustified=5
self.setMarginsBackgroundColor(self.color(QgsCodeEditorColorScheme.ColorRole.Background))
self.setEdgeMode(QsciScintilla.EdgeNone)
def _setMinimumHeight(self):
font = self.lexer().defaultFont(0)
fm = QFontMetrics(font)

View File

@ -313,6 +313,18 @@ void QgsCodeEditor::runPostLexerConfigurationTasks()
SendScintilla( SCI_MARKERSETBACK, SC_MARKNUM_FOLDER, lexerColor( QgsCodeEditorColorScheme::ColorRole::FoldIconForeground ) );
SendScintilla( SCI_STYLESETFORE, STYLE_INDENTGUIDE, lexerColor( QgsCodeEditorColorScheme::ColorRole::IndentationGuide ) );
SendScintilla( SCI_STYLESETBACK, STYLE_INDENTGUIDE, lexerColor( QgsCodeEditorColorScheme::ColorRole::IndentationGuide ) );
if ( mMode == QgsCodeEditor::Mode::CommandInput )
{
setCaretLineVisible( false );
setLineNumbersVisible( false ); // NO linenumbers for the input line
// Margin 1 is used for the '>' prompt (console input)
setMarginLineNumbers( 1, true );
setMarginWidth( 1, "00000" );
setMarginType( 1, QsciScintilla::MarginType::TextMarginRightJustified );
setMarginsBackgroundColor( color( QgsCodeEditorColorScheme::ColorRole::Background ) );
setEdgeMode( QsciScintilla::EdgeNone );
}
}
void QgsCodeEditor::setSciWidget()