make the caret color themeable
parent
a51fd04d0b
commit
7c383a52ba
|
@ -12,7 +12,6 @@ HELP: editor
|
|||
$nl
|
||||
"Editors have the following slots:"
|
||||
{ $list
|
||||
{ { $snippet "caret-color" } " - a " { $link color } "." }
|
||||
{ { $snippet "caret" } " - a " { $link model } " storing a line/column pair." }
|
||||
{ { $snippet "mark" } " - a " { $link model } " storing a line/column pair. If there is no selection, the mark is equal to the caret, otherwise the mark is located at the opposite end of the selection from the caret." }
|
||||
{ { $snippet "focused?" } " - a boolean." }
|
||||
|
|
|
@ -25,7 +25,6 @@ TUPLE: editor < line-gadget
|
|||
<loc> >>mark ; inline
|
||||
|
||||
: editor-theme ( editor -- editor )
|
||||
COLOR: red >>caret-color
|
||||
monospace-font >>font ; inline
|
||||
|
||||
PRIVATE>
|
||||
|
@ -158,11 +157,9 @@ M: editor ungraft*
|
|||
|
||||
: draw-caret ( editor -- )
|
||||
dup draw-caret? [
|
||||
[ caret-color>> gl-color ]
|
||||
[
|
||||
[ editor-caret-color gl-color ] dip
|
||||
[ caret-loc ] [ caret-dim ] bi
|
||||
over v+ gl-line
|
||||
] bi
|
||||
] [ drop ] if ;
|
||||
|
||||
: selection-start/end ( editor -- start end )
|
||||
|
|
|
@ -83,6 +83,7 @@ HOOK: vocab-border-color theme ( -- color )
|
|||
|
||||
HOOK: field-border-color theme ( -- color )
|
||||
|
||||
HOOK: editor-caret-color theme ( -- color )
|
||||
HOOK: selection-color theme ( -- color )
|
||||
HOOK: panel-background-color theme ( -- color )
|
||||
HOOK: focus-border-color theme ( -- color )
|
||||
|
@ -172,6 +173,7 @@ M: light-theme vocab-border-color COLOR: FactorDarkTan ;
|
|||
|
||||
M: light-theme field-border-color COLOR: gray ;
|
||||
|
||||
M: light-theme editor-caret-color COLOR: red ;
|
||||
M: light-theme selection-color T{ rgba f 0.8 0.8 1.0 1.0 } ;
|
||||
M: light-theme panel-background-color T{ rgba f 0.7843 0.7686 0.7176 1.0 } ;
|
||||
M: light-theme focus-border-color COLOR: dark-gray ;
|
||||
|
@ -260,6 +262,7 @@ M: dark-theme vocab-border-color COLOR: solarized-base01 ;
|
|||
|
||||
M: dark-theme field-border-color COLOR: solarized-base01 ;
|
||||
|
||||
M: dark-theme editor-caret-color COLOR: red ;
|
||||
M: dark-theme selection-color COLOR: solarized-base01 ;
|
||||
M: dark-theme panel-background-color T{ rgba f 0.7843 0.7686 0.7176 1.0 } ;
|
||||
M: dark-theme focus-border-color COLOR: solarized-base01 ;
|
||||
|
|
Loading…
Reference in New Issue