]> gitweb.factorcode.org Git - factor.git/commitdiff
Added listener styles in theme switching
authornicolas-p <z.nicolas@gmail.com>
Fri, 6 May 2016 09:31:29 +0000 (11:31 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 10 May 2016 04:40:56 +0000 (21:40 -0700)
basis/help/tips/tips.factor
basis/ui/gadgets/theme/switching/switching.factor
basis/ui/tools/listener/listener.factor

index 8fa876a96c5c1dfc3cbc0bfc569123d069b06732..7e6d40d7e9783fb26ed3c936345cc57588397778 100644 (file)
@@ -28,7 +28,6 @@ SYNTAX: TIP:
 : a-tip ( -- tip ) tips get random ;
 
 SYMBOL: tip-of-the-day-style
-
 H{
     { page-color $ tip-background-color }
     { inset { 5 5 } }
index 2a4918bb9e8a76ee5df4f637ee1dd9dad3fb9a50..8fb37d562465a8a4d48b1e85b3f1c0cc381ba2e0 100644 (file)
@@ -1,7 +1,7 @@
 ! 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 -- )
@@ -21,7 +21,9 @@ IN: ui.gadgets.theme.switching
     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 ;
index 6b217c327e8bc2f375556699f2d75942d03b437c..1aaf99f6937b94e4e5cad0de8742a5e5fbf7cdd6 100644 (file)
@@ -95,19 +95,26 @@ M: interactor stream-element-type drop +character+ ;
 
 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* ;