: a-tip ( -- tip ) tips get random ;
SYMBOL: tip-of-the-day-style
-
H{
{ page-color $ tip-background-color }
{ inset { 5 5 } }
! Copyright (C) 2016 Nicolas PĂ©net.
! See http://factorcode.org/license.txt for BSD license.
USING: fry hashtables help.stylesheet help.tips io.styles
-kernel listener namespaces ui.gadgets.theme ;
+kernel listener namespaces ui.gadgets.theme ui.tools.listener ;
IN: ui.gadgets.theme.switching
: (update-style) ( style color elt -- )
table-style line-color table-border (update-style)
prompt-style prompt-background-color background (update-style)
prompt-style text-color foreground (update-style)
- tip-of-the-day-style tip-background-color page-color (update-style) ;
+ tip-of-the-day-style tip-background-color page-color (update-style)
+ listener-input-style text-color foreground (update-style)
+ listener-word-style text-color foreground (update-style) ;
: light-mode ( -- ) light-theme theme set-global update-stylesheet ;
: dark-mode ( -- ) dark-theme theme set-global update-stylesheet ;
GENERIC: (print-input) ( object -- )
+SYMBOL: listener-input-style
+H{
+ { font-style bold }
+ { foreground $ text-color }
+} listener-input-style set-global
+
+SYMBOL: listener-word-style
+H{
+ { font-name "sans-serif" }
+ { font-style bold }
+ { foreground $ text-color }
+} listener-word-style set-global
+
M: input (print-input)
dup presented associate [
- string>>
- H{ { font-style bold } { foreground $ text-color } }
- format
+ string>> listener-input-style get-global format
] with-nesting nl ;
M: word (print-input)
- "Command: "
- H{ { font-name "sans-serif" }
- { font-style bold }
- { foreground $ text-color }
- } format . ;
+ "Command: " listener-word-style get-global format . ;
: print-input ( object interactor -- )
output>> [ (print-input) ] with-output-stream* ;