]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/theme/switching/switching.factor
ui.theme.switching: fix help-path-style foreground.
[factor.git] / basis / ui / theme / switching / switching.factor
1 ! Copyright (C) 2016 Nicolas PĂ©net.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs fonts hashtables help.stylesheet help.tips
4 io.styles kernel listener memoize namespaces
5 prettyprint.stylesheet sequences ui.gadgets.panes.private
6 ui.theme ui.tools.listener vocabs.prettyprint words ;
7 IN: ui.theme.switching
8
9 <PRIVATE
10
11 : update-style ( style color elt -- )
12     '[ _ _ rot ?set-at ] change-global ;
13
14 : update-stylesheet ( -- )
15     ! fonts
16     text-color default-font-foreground-color set-global
17     content-background default-font-background-color set-global
18
19     ! ui.gadgets.panes
20     \ specified-font reset-memoized
21
22     ! help.stylesheet
23     default-style text-color foreground update-style
24     link-style link-color foreground update-style
25     title-style title-color foreground update-style
26     title-style help-header-background page-color update-style
27     help-path-style text-color foreground update-style
28     help-path-style help-path-border-color table-border update-style
29     heading-style heading-color foreground update-style
30     snippet-style snippet-color foreground update-style
31     code-style code-background-color page-color update-style
32     output-style output-color foreground update-style
33     url-style link-color foreground update-style
34     warning-style warning-background-color page-color update-style
35     warning-style warning-border-color border-color update-style
36     deprecated-style deprecated-background-color page-color update-style
37     deprecated-style deprecated-border-color border-color update-style
38     table-style table-border-color table-border update-style
39
40     ! help.tips
41     tip-of-the-day-style tip-background-color page-color update-style
42
43     ! ui.tools.listener
44     listener-input-style text-color foreground update-style
45     listener-word-style text-color foreground update-style
46
47     ! prettyprint.stylesheet
48     { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: }
49     [ "word-style" word-prop [ dim-color foreground  ] dip set-at ] each
50     base-word-style text-color foreground update-style
51     highlighted-word-style highlighted-word-color foreground update-style
52     base-string-style string-color foreground update-style
53     base-vocab-style dim-color foreground update-style
54     base-effect-style stack-effect-color foreground update-style
55
56     ! listener
57     prompt-style prompt-background-color background update-style
58     prompt-style text-color foreground update-style
59
60     ! vocabs.prettyprint
61     manifest-style vocab-background-color page-color update-style
62     manifest-style vocab-border-color border-color update-style ;
63
64 PRIVATE>
65
66 : switch-theme ( theme -- )
67     theme set-global update-stylesheet ;
68
69 : light-mode ( -- ) light-theme switch-theme ;
70
71 : dark-mode ( -- ) dark-theme switch-theme ;