H{
{ font-name $ default-sans-serif-font-name }
{ font-size $ font-size-span }
+ { foreground $ text-color }
{ font-style plain }
} default-span-style set-global
M: word word-style
[ presented associate ]
- [ "word-style" word-prop ] bi assoc-union! ;
+ [ "word-style" word-prop ] bi assoc-union!
+ text-color foreground pick set-at ;
M: highlighted-word word-style
call-next-method
<button-pen> ;
: border-button-label-theme ( gadget -- )
- dup label? [ [ clone t >>bold? ] change-font ] when drop ;
+ dup label? [ [ clone t >>bold? text-color >>foreground ] change-font ] when drop ;
: border-button-theme ( gadget -- gadget )
dup gadget-child border-button-label-theme
: add-title-bar ( title track -- track )
swap >label
- [ t >>bold? ] change-font
+ [ t >>bold? text-color >>foreground ] change-font
{ 0 4 } <border>
title-bar-interior >>interior
f track-add ;
USING: accessors arrays colors.constants combinators fonts fry
kernel make math.functions models namespaces sequences splitting
strings ui.baseline-alignment ui.gadgets ui.gadgets.tracks
-ui.pens.solid ui.render ui.text ;
+ui.pens.solid ui.render ui.text ui.tools.common ;
IN: ui.gadgets.labels
! A label gadget draws a string.
swap >>model ;
: text-theme ( gadget -- gadget )
- monospace-font >>font ;
+ monospace-font >>font theme-font-colors ;
: reverse-video-theme ( label -- label )
sans-serif-font reverse-video-font >>font
: <search-field> ( browser -- field )
'[ _ search-browser ] <action-field>
+ [ theme-font-colors ] change-editor
"Search" >>default-text
10 >>min-cols
10 >>max-cols
: white-interior ( track -- track )
content-background <solid> >>interior ;
+
+: theme-font-colors ( gadget -- gadget )
+ [ content-background >>background text-color >>foreground ] change-font ;
[ error>> <error-pane> add-gadget ]
[
dup restart-hook>> [
- [ "To continue, pick one of the options below:" <label> add-gadget ] dip
+ [ "To continue, pick one of the options below:" <label> theme-font-colors add-gadget ] dip
restart-list>> add-gadget
] [ drop ] if
] bi ;
: <inspector-table> ( model -- table )
[ make-slot-descriptions ] <arrow> inspector-renderer <table>
[ invoke-primary-operation ] >>action
- monospace-font >>font
- COLOR: dark-gray >>column-line-color
+ monospace-font >>font theme-font-colors
+ line-color >>column-line-color
6 >>gap
15 >>min-rows
15 >>max-rows
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs calendar colors colors.constants
-documents documents.elements fry kernel words sets splitting math
-math.vectors models.delay models.arrow combinators.short-circuit
-parser present sequences tools.completion help.vocabs generic fonts
-definitions.icons ui.images ui.commands ui.operations ui.gadgets
-ui.gadgets.editors ui.gadgets.glass ui.gadgets.scrollers
-ui.gadgets.tables ui.gadgets.tracks ui.gadgets.labeled ui.gadgets.theme
-ui.gadgets.worlds ui.gadgets.wrappers ui.gestures ui.pens.solid
-ui.tools.listener.history combinators vocabs ui.tools.listener.popups ;
+combinators combinators.short-circuit definitions.icons
+documents documents.elements fonts fry generic help.vocabs
+kernel math math.vectors models.arrow models.delay parser
+present sequences sets splitting tools.completion ui.commands
+ui.gadgets ui.gadgets.editors ui.gadgets.glass
+ui.gadgets.labeled ui.gadgets.scrollers ui.gadgets.tables
+ui.gadgets.theme ui.gadgets.tracks ui.gadgets.worlds
+ui.gadgets.wrappers ui.gestures ui.images ui.operations
+ui.pens.solid ui.tools.common ui.tools.listener.history
+ui.tools.listener.popups vocabs words ;
IN: ui.tools.listener.completion
! We don't directly depend on the listener tool but we use a few slots
: <completion-table> ( interactor completion-mode -- table )
[ completion-element ] [ completion-quot ] [ nip ] 2tri
[ <completion-model> ] dip <table>
- monospace-font >>font
+ monospace-font >>font theme-font-colors
t >>selection-required?
t >>single-click?
30 >>min-cols
: <interactor> ( -- gadget )
interactor new-editor
+ theme-font-colors
<flag> >>flag
dup one-word-elt <element-model> >>token-model
dup <word-model> >>word-model
GENERIC: (print-input) ( object -- )
M: input (print-input)
- dup presented associate
- [ string>> H{ { font-style bold } } format ] with-nesting nl ;
+ dup presented associate [
+ string>>
+ H{ { font-style bold } { foreground $ text-color } }
+ format
+ ] with-nesting nl ;
M: word (print-input)
- "Command: " H{ { font-name "sans-serif" } { font-style bold } }
- format . ;
+ "Command: "
+ H{ { font-name "sans-serif" }
+ { font-style bold }
+ { foreground $ text-color }
+ } format . ;
: print-input ( object interactor -- )
output>> [ (print-input) ] with-output-stream* ;
10 >>max-rows
40 >>min-cols
40 >>max-cols
- monospace-font >>font
+ monospace-font >>font theme-font-colors
[ i:inspector ] >>action
t >>single-click? ;
: add-thread-status ( track -- track )
horizontal <track> { 5 5 } >>gap
"Thread:" <label>
- dup font>> t >>bold? drop
+ [ t >>bold? text-color >>foreground ] change-font
f track-add
- self name>> <label> f track-add
+ self name>> <label> [ text-color >>foreground ] change-font f track-add
over status>> <thread-status>
dup font>> t >>bold? drop
f track-add