Line number colors
This commit is contained in:
@@ -67,6 +67,8 @@ palette(light) ->
|
|||||||
?STRING => ?red,
|
?STRING => ?red,
|
||||||
?NUMBER => ?magenta,
|
?NUMBER => ?magenta,
|
||||||
?OPERATOR => ?brown,
|
?OPERATOR => ?brown,
|
||||||
|
line_num => ?brown,
|
||||||
|
cursor => ?black,
|
||||||
bg => ?high_white};
|
bg => ?high_white};
|
||||||
palette(dark) ->
|
palette(dark) ->
|
||||||
#{?DEFAULT => ?white,
|
#{?DEFAULT => ?white,
|
||||||
@@ -76,6 +78,8 @@ palette(dark) ->
|
|||||||
?STRING => ?light_red,
|
?STRING => ?light_red,
|
||||||
?NUMBER => ?light_magenta,
|
?NUMBER => ?light_magenta,
|
||||||
?OPERATOR => ?yellow,
|
?OPERATOR => ?yellow,
|
||||||
|
line_num => ?light_cyan,
|
||||||
|
cursor => ?white,
|
||||||
bg => ?not_black}.
|
bg => ?not_black}.
|
||||||
|
|
||||||
color_mode() ->
|
color_mode() ->
|
||||||
@@ -114,13 +118,15 @@ set_text(STC, Text) ->
|
|||||||
|
|
||||||
set_colors(STC) ->
|
set_colors(STC) ->
|
||||||
ok = wxStyledTextCtrl:styleClearAll(STC),
|
ok = wxStyledTextCtrl:styleClearAll(STC),
|
||||||
Palette = #{bg := BGC} = palette(color_mode()),
|
Palette = #{bg := BGC, cursor := CC, line_num := LNC} = palette(color_mode()),
|
||||||
Colorize =
|
Colorize =
|
||||||
fun(Style) ->
|
fun(Style) ->
|
||||||
Color = maps:get(Style, Palette),
|
Color = maps:get(Style, Palette),
|
||||||
ok = wxStyledTextCtrl:styleSetForeground(STC, Style, Color),
|
ok = wxStyledTextCtrl:styleSetForeground(STC, Style, Color),
|
||||||
ok = wxStyledTextCtrl:styleSetBackground(STC, Style, BGC)
|
ok = wxStyledTextCtrl:styleSetBackground(STC, Style, BGC)
|
||||||
end,
|
end,
|
||||||
|
ok = wxStyledTextCtrl:setCaretForeground(STC, CC),
|
||||||
|
ok = wxStyledTextCtrl:styleSetForeground(STC, ?wxSTC_STYLE_LINENUMBER, LNC),
|
||||||
ok = wxStyledTextCtrl:styleSetBackground(STC, ?wxSTC_STYLE_DEFAULT, BGC),
|
ok = wxStyledTextCtrl:styleSetBackground(STC, ?wxSTC_STYLE_DEFAULT, BGC),
|
||||||
lists:foreach(Colorize, styles()).
|
lists:foreach(Colorize, styles()).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user