]> gitweb.factorcode.org Git - factor.git/commitdiff
help browser: tweaked the colors based on user feedback.
authorKeith Lazuka <klazuka@gmail.com>
Thu, 10 Sep 2009 13:48:20 +0000 (09:48 -0400)
committerKeith Lazuka <klazuka@gmail.com>
Thu, 10 Sep 2009 17:27:49 +0000 (13:27 -0400)
The USING: line should be easier to read now.
I also decided to stop highlighting symbols.

basis/help/help.factor
basis/help/stylesheet/stylesheet.factor
basis/prettyprint/stylesheet/stylesheet.factor

index c7e7f225dcf631a2993a56a9ee5884f86095eb89..214ff14632ecdc432861f1d71730f0a8e39c4d21 100644 (file)
@@ -99,12 +99,15 @@ M: word set-article-parent swap "help-parent" set-word-prop ;
 : $navigation-row ( content element label -- )
     [ prefix 1array ] dip prefix , ;
 
+: ($navigation-table) ( element -- )
+    help-path-style get table-style set [ $table ] with-scope ;
+
 : $navigation-table ( topic -- )
     [
         [ prev-article [ 1array \ $long-link "Prev:" $navigation-row ] when* ]
         [ next-article [ 1array \ $long-link "Next:" $navigation-row ] when* ]
         bi
-    ] { } make [ $table ] unless-empty ;
+    ] { } make [ ($navigation-table) ] unless-empty ;
 
 : ($navigation) ( topic -- )
     help-path-style get [
index c2e8e98476e8c251e997a20843e2de1f48e1457b..2475fba0f6f217e7e66ad03c3cfafa5f51f67a65 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: io.styles namespaces colors colors.constants ;
+USING: colors colors.constants io.styles literals namespaces ;
 IN: help.stylesheet
 
 SYMBOL: default-span-style
@@ -34,12 +34,16 @@ H{
     { font-style bold }
     { wrap-margin 500 }
     { foreground COLOR: gray20 }
-    { page-color COLOR: FactorLightTan }
+    { page-color COLOR: FactorLightLightTan }
     { inset { 5 5 } }
 } title-style set-global
 
 SYMBOL: help-path-style
-H{ { font-size 10 } } help-path-style set-global
+H{
+    { font-size 10 }
+    { table-gap { 5 5 } }
+    { table-border $ transparent }
+} help-path-style set-global
 
 SYMBOL: heading-style
 H{
@@ -71,7 +75,7 @@ H{
 
 SYMBOL: code-style
 H{
-    { page-color COLOR: FactorLightTan }
+    { page-color COLOR: FactorLightLightTan }
     { inset { 5 5 } }
     { wrap-margin f }
 } code-style set-global
index f04893fab3696a5d121498b2724af611bc16ba66..fbd95ecbd2e3f89636470cacf020f26631ac032d 100644 (file)
@@ -7,27 +7,28 @@ IN: prettyprint.stylesheet
 
 <PRIVATE
 
-CONSTANT: dim-color COLOR: cornsilk4
+CONSTANT: dim-color COLOR: gray35
+CONSTANT: alt-color COLOR: DarkSlateGray
 
 : dimly-lit-word? ( word -- ? )
     { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: } memq? ;
 
-: parsing-word-color ( word -- color )
-    dimly-lit-word? dim-color COLOR: DarkSlateGray ? ;
+: parsing-or-delim-word? ( word -- ? )
+    [ parsing-word? ] [ delimiter? ] bi or ;
+
+: word-color ( word -- color )
+    {
+        { [ dup dimly-lit-word? ] [ drop dim-color ] }
+        { [ dup parsing-or-delim-word? ] [ drop alt-color ] }
+        [ drop COLOR: black ]
+    } cond ;
 
 PRIVATE>
 
 : word-style ( word -- style )
     dup "word-style" word-prop >hashtable [
         [
-            [ presented set ] [
-                {
-                    { [ dup parsing-word? ] [ parsing-word-color ] }
-                    { [ dup delimiter? ] [ drop COLOR: DarkSlateGray ] }
-                    { [ dup symbol? ] [ drop COLOR: DarkSlateGray ] }
-                    [ drop COLOR: black ]
-                } cond foreground set
-            ] bi
+            [ presented set ] [ word-color foreground set ] bi
         ] bind
     ] keep ;