2016-05-05 17:06:36 -04:00
|
|
|
! Copyright (C) 2016 Nicolas Pénet.
|
2016-05-05 15:18:51 -04:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2016-05-10 00:34:31 -04:00
|
|
|
USING: assocs fry hashtables help.stylesheet help.tips io.styles
|
|
|
|
kernel listener namespaces prettyprint.stylesheet sequences
|
|
|
|
ui.theme ui.tools.listener vocabs.prettyprint words ;
|
2016-05-08 04:09:44 -04:00
|
|
|
IN: ui.theme.switching
|
2016-05-05 15:18:51 -04:00
|
|
|
|
|
|
|
: (update-style) ( style color elt -- )
|
|
|
|
'[ _ _ rot ?set-at ] change-global ;
|
|
|
|
|
|
|
|
: update-stylesheet ( -- )
|
2016-05-10 00:34:31 -04:00
|
|
|
|
|
|
|
! help.stylesheet
|
2016-05-05 15:18:51 -04:00
|
|
|
default-span-style text-color foreground (update-style)
|
|
|
|
link-style link-color foreground (update-style)
|
|
|
|
title-style title-color foreground (update-style)
|
2016-05-10 00:34:31 -04:00
|
|
|
help-path-style help-path-border-color table-border (update-style)
|
2016-05-05 15:18:51 -04:00
|
|
|
heading-style heading-color foreground (update-style)
|
|
|
|
snippet-style snippet-color foreground (update-style)
|
|
|
|
code-style code-background-color page-color (update-style)
|
|
|
|
output-style output-color foreground (update-style)
|
2016-05-10 00:34:31 -04:00
|
|
|
url-style link-color foreground (update-style)
|
2016-05-05 15:18:51 -04:00
|
|
|
warning-style warning-background-color page-color (update-style)
|
2016-05-10 00:34:31 -04:00
|
|
|
warning-style warning-border-color border-color (update-style)
|
|
|
|
deprecated-style deprecated-background-color page-color (update-style)
|
|
|
|
deprecated-style deprecated-border-color border-color (update-style)
|
|
|
|
table-style table-border-color table-border (update-style)
|
|
|
|
|
|
|
|
! help.tips
|
2016-05-06 05:31:29 -04:00
|
|
|
tip-of-the-day-style tip-background-color page-color (update-style)
|
2016-05-10 00:34:31 -04:00
|
|
|
|
|
|
|
! ui.tools.listener
|
2016-05-06 05:31:29 -04:00
|
|
|
listener-input-style text-color foreground (update-style)
|
2016-05-10 00:34:31 -04:00
|
|
|
listener-word-style text-color foreground (update-style)
|
|
|
|
|
|
|
|
! prettyprint.stylesheet
|
|
|
|
{ POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: }
|
|
|
|
[ "word-style" word-prop [ dim-color foreground ] dip set-at ] each
|
|
|
|
base-word-style text-color foreground (update-style)
|
|
|
|
highlighted-word-style highlighted-word-color foreground (update-style)
|
|
|
|
base-string-style string-color foreground (update-style)
|
|
|
|
base-vocab-style dim-color foreground (update-style)
|
|
|
|
stack-effect-style stack-effect-color foreground (update-style)
|
|
|
|
|
|
|
|
! listener
|
|
|
|
prompt-style prompt-background-color background (update-style)
|
|
|
|
prompt-style text-color foreground (update-style)
|
|
|
|
|
|
|
|
! vocabs.prettyprint
|
|
|
|
manifest-style vocab-background-color page-color (update-style)
|
|
|
|
manifest-style vocab-border-color border-color (update-style) ;
|
2016-05-05 15:18:51 -04:00
|
|
|
|
2016-05-10 00:34:31 -04:00
|
|
|
: light-mode ( -- )
|
|
|
|
light-theme theme set-global update-stylesheet ;
|
2016-05-05 15:18:51 -04:00
|
|
|
|
2016-05-10 00:34:31 -04:00
|
|
|
: dark-mode ( -- )
|
|
|
|
dark-theme theme set-global update-stylesheet ;
|