From e1979f5ad55aac4e043f801122e4bf144f739b99 Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Thu, 10 Sep 2009 09:48:20 -0400 Subject: [PATCH] help browser: tweaked the colors based on user feedback. The USING: line should be easier to read now. I also decided to stop highlighting symbols. --- basis/help/help.factor | 5 +++- basis/help/stylesheet/stylesheet.factor | 12 ++++++---- .../prettyprint/stylesheet/stylesheet.factor | 23 ++++++++++--------- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/basis/help/help.factor b/basis/help/help.factor index c7e7f225dc..214ff14632 100644 --- a/basis/help/help.factor +++ b/basis/help/help.factor @@ -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 [ diff --git a/basis/help/stylesheet/stylesheet.factor b/basis/help/stylesheet/stylesheet.factor index c2e8e98476..2475fba0f6 100644 --- a/basis/help/stylesheet/stylesheet.factor +++ b/basis/help/stylesheet/stylesheet.factor @@ -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 diff --git a/basis/prettyprint/stylesheet/stylesheet.factor b/basis/prettyprint/stylesheet/stylesheet.factor index f04893fab3..fbd95ecbd2 100644 --- a/basis/prettyprint/stylesheet/stylesheet.factor +++ b/basis/prettyprint/stylesheet/stylesheet.factor @@ -7,27 +7,28 @@ IN: prettyprint.stylesheet : 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 ;