Skip to content
Permalink
Browse files

Split indentation guide color from edge color in code editor settings

Reusing the same color resulted in too subtle indentation guides
  • Loading branch information
nyalldawson committed Oct 12, 2020
1 parent cce7aa7 commit aaa813a15adf2e99e18e29b54974970bf24596e6
@@ -56,6 +56,7 @@ Defines a color scheme for use in QgsCodeEditor widgets.
Error,
FoldIconForeground,
FoldIconHalo,
IndentationGuide,
};

QgsCodeEditorColorScheme( const QString &id = QString(), const QString &name = QString() );
@@ -68,6 +68,7 @@ QgsCodeEditorOptionsWidget::QgsCodeEditorOptionsWidget( QWidget *parent )
{QgsCodeEditorColorScheme::ColorRole::Error, mColorError },
{QgsCodeEditorColorScheme::ColorRole::FoldIconForeground, mColorFoldIcon },
{QgsCodeEditorColorScheme::ColorRole::FoldIconHalo, mColorFoldIconHalo },
{QgsCodeEditorColorScheme::ColorRole::IndentationGuide, mColorIndentation },
};

for ( auto it = mColorButtonMap.constBegin(); it != mColorButtonMap.constEnd(); ++it )
@@ -63,6 +63,7 @@ QMap< QgsCodeEditorColorScheme::ColorRole, QString > QgsCodeEditor::sColorRoleTo
{QgsCodeEditorColorScheme::ColorRole::Error, QStringLiteral( "stderrFontColor" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconForeground, QStringLiteral( "foldIconForeground" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconHalo, QStringLiteral( "foldIconHalo" ) },
{QgsCodeEditorColorScheme::ColorRole::IndentationGuide, QStringLiteral( "indentationGuide" ) },
};


@@ -201,8 +202,8 @@ void QgsCodeEditor::runPostLexerConfigurationTasks()
SendScintilla( SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPEN, lexerColor( QgsCodeEditorColorScheme::ColorRole::FoldIconForeground ) );
SendScintilla( SCI_MARKERSETFORE, SC_MARKNUM_FOLDER, lexerColor( QgsCodeEditorColorScheme::ColorRole::FoldIconHalo ) );
SendScintilla( SCI_MARKERSETBACK, SC_MARKNUM_FOLDER, lexerColor( QgsCodeEditorColorScheme::ColorRole::FoldIconForeground ) );
SendScintilla( SCI_STYLESETFORE, STYLE_INDENTGUIDE, lexerColor( QgsCodeEditorColorScheme::ColorRole::Edge ) );
SendScintilla( SCI_STYLESETBACK, STYLE_INDENTGUIDE, lexerColor( QgsCodeEditorColorScheme::ColorRole::Edge ) );
SendScintilla( SCI_STYLESETFORE, STYLE_INDENTGUIDE, lexerColor( QgsCodeEditorColorScheme::ColorRole::IndentationGuide ) );
SendScintilla( SCI_STYLESETBACK, STYLE_INDENTGUIDE, lexerColor( QgsCodeEditorColorScheme::ColorRole::IndentationGuide ) );
}

void QgsCodeEditor::setSciWidget()
@@ -353,6 +354,7 @@ QColor QgsCodeEditor::defaultColor( QgsCodeEditorColorScheme::ColorRole role, co
{QgsCodeEditorColorScheme::ColorRole::Error, QStringLiteral( "stderrFontColor" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconForeground, QStringLiteral( "foldIconForeground" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconHalo, QStringLiteral( "foldIconHalo" ) },
{QgsCodeEditorColorScheme::ColorRole::IndentationGuide, QStringLiteral( "indentationGuide" ) },
};

const QgsCodeEditorColorScheme defaultScheme = QgsGui::codeEditorColorSchemeRegistry()->scheme( QStringLiteral( "default" ) );
@@ -69,6 +69,7 @@ class GUI_EXPORT QgsCodeEditorColorScheme
Error, //!< Error color
FoldIconForeground, //!< Fold icon foreground color
FoldIconHalo, //!< Fold icon halo color
IndentationGuide, //!< Indentation guide line
};

/**
@@ -54,6 +54,7 @@ QgsCodeEditorColorSchemeRegistry::QgsCodeEditorColorSchemeRegistry()
{QgsCodeEditorColorScheme::ColorRole::Error, QColor( "#e31a1c" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconForeground, QColor( "#ffffff" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconHalo, QColor( "#000000" ) },
{QgsCodeEditorColorScheme::ColorRole::IndentationGuide, QColor( "#d5d5d5" ) },
} );
addColorScheme( defaultScheme );

@@ -93,6 +94,7 @@ QgsCodeEditorColorSchemeRegistry::QgsCodeEditorColorSchemeRegistry()
{QgsCodeEditorColorScheme::ColorRole::Error, QColor( "#DC322F" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconForeground, QColor( "#ffffff" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconHalo, QColor( "#93a1a1" ) },
{QgsCodeEditorColorScheme::ColorRole::IndentationGuide, QColor( "#c2beb3" ) },
} );
addColorScheme( solarizedLight );

@@ -132,6 +134,7 @@ QgsCodeEditorColorSchemeRegistry::QgsCodeEditorColorSchemeRegistry()
{QgsCodeEditorColorScheme::ColorRole::Error, QColor( "#DC322F" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconForeground, QColor( "#586e75" ) },
{QgsCodeEditorColorScheme::ColorRole::FoldIconHalo, QColor( "#839496" ) },
{QgsCodeEditorColorScheme::ColorRole::IndentationGuide, QColor( "#586E75" ) },
} );
addColorScheme( solarizedDark );
}

0 comments on commit aaa813a

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