Skip to content

Commit 3510728

Browse files
committed
feat: sync active line color and brace highlight with the app's dark or light mode
It's a pity these additional colors sit on a TSynEdit, not on a TSynSQLSyn. Even with the new TSynSQLSynSchemes we cannot provide these in presets. In the preferences, the user still has to edit these colors manually.
1 parent 8a08e77 commit 3510728

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/generic_types.pas

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ procedure TSynSQLSynSchemes.ApplyScheme(Scheme: TSynSQLSyn);
189189
AppSettings.WriteInt(asHighlighterBackground, Attri.Background, Attri.Name);
190190
AppSettings.WriteInt(asHighlighterStyle, Attri.IntegerStyle, Attri.Name);
191191
end;
192+
if Scheme.Name = SDarkScheme then begin
193+
AppSettings.WriteString(asSQLColActiveLine, ColorToString(clNone));
194+
AppSettings.WriteString(asSQLColMatchingBraceForeground, ColorToString($0028EFFF));
195+
AppSettings.WriteString(asSQLColMatchingBraceBackground, ColorToString($004D513B));
196+
end
197+
else if Scheme.Name = SLightScheme then begin
198+
AppSettings.WriteString(asSQLColActiveLine, ColorToString(clNone));
199+
AppSettings.WriteString(asSQLColMatchingBraceForeground, AppSettings.GetDefaultString(asSQLColMatchingBraceForeground));
200+
AppSettings.WriteString(asSQLColMatchingBraceBackground, AppSettings.GetDefaultString(asSQLColMatchingBraceBackground));
201+
end
192202
end;
193203

194204
procedure TSynSQLSynSchemes.ApplyScheme(SchemeName: String);

0 commit comments

Comments
 (0)