From: John Benediktsson Date: Tue, 10 May 2016 04:34:31 +0000 (-0700) Subject: ui.theme: updates to color scheme. X-Git-Tag: unmaintained~1048 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=63410f62c85864e36e476f2c47eb7654087beb57 ui.theme: updates to color scheme. Fixes circularity and adds theme switching to Mac menu. Could use some simplification and reduction in color theme hooks. --- diff --git a/Factor.app/Contents/Resources/English.lproj/Factor.nib/classes.nib b/Factor.app/Contents/Resources/English.lproj/Factor.nib/classes.nib deleted file mode 100644 index 6a6eedfcc0..0000000000 --- a/Factor.app/Contents/Resources/English.lproj/Factor.nib/classes.nib +++ /dev/null @@ -1,38 +0,0 @@ - - - - - IBClasses - - - ACTIONS - - factorBrowser - id - factorListener - id - newFactorBrowser - id - newFactorListener - id - refreshAll - id - runFactorFile - id - saveFactorImage - id - saveFactorImageAs - id - - CLASS - FirstResponder - LANGUAGE - ObjC - SUPERCLASS - NSObject - - - IBVersion - 1 - - diff --git a/Factor.app/Contents/Resources/English.lproj/Factor.nib/designable.nib b/Factor.app/Contents/Resources/English.lproj/Factor.nib/designable.nib new file mode 100644 index 0000000000..74aa0193e2 --- /dev/null +++ b/Factor.app/Contents/Resources/English.lproj/Factor.nib/designable.nib @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Factor.app/Contents/Resources/English.lproj/Factor.nib/info.nib b/Factor.app/Contents/Resources/English.lproj/Factor.nib/info.nib deleted file mode 100644 index 1d9f641c11..0000000000 --- a/Factor.app/Contents/Resources/English.lproj/Factor.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBFramework Version - 677 - IBOldestOS - 5 - IBOpenObjects - - IBSystem Version - 9J61 - targetFramework - IBCocoaFramework - - diff --git a/Factor.app/Contents/Resources/English.lproj/Factor.nib/keyedobjects.nib b/Factor.app/Contents/Resources/English.lproj/Factor.nib/keyedobjects.nib index 1659393f2e..67eedf8402 100644 Binary files a/Factor.app/Contents/Resources/English.lproj/Factor.nib/keyedobjects.nib and b/Factor.app/Contents/Resources/English.lproj/Factor.nib/keyedobjects.nib differ diff --git a/basis/help/stylesheet/stylesheet.factor b/basis/help/stylesheet/stylesheet.factor index 2396d2e24a..fe5a6984b8 100644 --- a/basis/help/stylesheet/stylesheet.factor +++ b/basis/help/stylesheet/stylesheet.factor @@ -108,12 +108,13 @@ H{ SYMBOL: url-style H{ { font-name $ default-monospace-font-name } - { foreground $ url-color } + { foreground $ link-color } } url-style set-global SYMBOL: warning-style H{ { page-color $ warning-background-color } + { border-color $ warning-border-color } { inset { 5 5 } } { wrap-margin $ wrap-margin-full } } warning-style set-global @@ -121,6 +122,7 @@ H{ SYMBOL: deprecated-style H{ { page-color $ warning-background-color } + { border-color $ warning-border-color } { inset { 5 5 } } { wrap-margin $ wrap-margin-full } } deprecated-style set-global diff --git a/basis/help/tips/tips-docs.factor b/basis/help/tips/tips-docs.factor index b682ed1da0..9529103ddd 100644 --- a/basis/help/tips/tips-docs.factor +++ b/basis/help/tips/tips-docs.factor @@ -1,6 +1,6 @@ USING: debugger editors help help.apropos help.markup help.syntax help.vocabs memory see stack-checker -tools.destructors tools.time ui.theme.switching ; +tools.destructors tools.time ; IN: help.tips TIP: "To look at the most recent error, run " { $link :error } ". To look at the most recent error's callstack, run " { $link :c } "." ; @@ -27,8 +27,6 @@ TIP: "To save time on reloading big libraries such as the " { $vocab-link "furna TIP: "Use the " { $link leaks. } " combinator to track down resource leaks." ; -TIP: "Use " { $link light-mode } " and " { $link dark-mode } " for a light or dark user interface." ; - HELP: TIP: { $syntax "TIP: content ;" } { $values { "content" "a markup element" } } diff --git a/basis/listener/listener.factor b/basis/listener/listener.factor index d256e747e7..5099c5ab90 100644 --- a/basis/listener/listener.factor +++ b/basis/listener/listener.factor @@ -4,7 +4,7 @@ USING: accessors colors colors.constants combinators.short-circuit compiler.units continuations debugger fry io io.styles kernel lexer literals locals math math.parser namespaces parser parser.notes prettyprint sequences sets -source-files.errors system ui.theme vocabs vocabs.loader +source-files.errors system vocabs vocabs.loader vocabs.parser ; IN: listener @@ -17,8 +17,8 @@ GENERIC# prompt. 1 ( stream prompt -- ) SYMBOL: prompt-style H{ - { background $ prompt-background-color } - { foreground $ text-color } + { background T{ rgba f 1 0.7 0.7 1 } } + { foreground COLOR: black } } prompt-style set-global M: object prompt. diff --git a/basis/prettyprint/stylesheet/stylesheet.factor b/basis/prettyprint/stylesheet/stylesheet.factor index 51544e5b3c..ccdedde73d 100644 --- a/basis/prettyprint/stylesheet/stylesheet.factor +++ b/basis/prettyprint/stylesheet/stylesheet.factor @@ -1,15 +1,15 @@ ! Copyright (C) 2009 Keith Lazuka, Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: assocs colors combinators +USING: assocs colors colors.constants combinators combinators.short-circuit hashtables io.styles kernel literals -namespaces sequences ui.theme words words.symbol ; +namespaces sequences words words.symbol ; IN: prettyprint.stylesheet +SYMBOL: base-word-style +H{ } base-word-style set-global + GENERIC: word-style ( word -- style ) M: word word-style - [ presented associate ] - [ "word-style" word-prop ] bi assoc-union! - text-color foreground pick set-at ; - -M: highlighted-word word-style - call-next-method - highlighted-word-color foreground pick set-at ; + [ presented base-word-style get clone [ set-at ] keep ] + [ "word-style" word-prop ] bi assoc-union! ; - [ - [ presented foreground ] dip - [ set-at ] curry bi-curry@ bi* - ] keep ; +M: highlighted-word word-style + call-next-method highlighted-word-style get assoc-union! ; -PRIVATE> +SYMBOL: base-string-style +H{ + { foreground COLOR: LightSalmon4 } +} base-string-style set-global : string-style ( str -- style ) - string-color colored-presentation-style ; + presented base-string-style get clone [ set-at ] keep ; + +SYMBOL: base-vocab-style +H{ + { foreground COLOR: gray35 } +} base-vocab-style set-global : vocab-style ( vocab -- style ) - dim-color colored-presentation-style ; + presented base-vocab-style get clone [ set-at ] keep ; SYMBOL: stack-effect-style - H{ - { foreground $ stack-effect-color } + { foreground COLOR: FactorDarkGreen } { font-style plain } } stack-effect-style set-global : effect-style ( effect -- style ) - presented associate stack-effect-style get assoc-union! ; + presented stack-effect-style get clone [ set-at ] keep ; diff --git a/basis/ui/backend/cocoa/tools/tools.factor b/basis/ui/backend/cocoa/tools/tools.factor index 94d522c933..a514d8c102 100644 --- a/basis/ui/backend/cocoa/tools/tools.factor +++ b/basis/ui/backend/cocoa/tools/tools.factor @@ -1,11 +1,11 @@ ! Copyright (C) 2006, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax cocoa cocoa.nibs cocoa.application -cocoa.classes cocoa.dialogs cocoa.pasteboard cocoa.runtime -cocoa.subclassing core-foundation core-foundation.strings -help.topics kernel memory namespaces parser system ui -ui.tools.browser ui.tools.listener ui.backend.cocoa eval -locals listener vocabs.refresh ; +USING: alien.syntax cocoa cocoa.application cocoa.classes +cocoa.dialogs cocoa.nibs cocoa.pasteboard cocoa.runtime +cocoa.subclassing core-foundation.strings eval kernel listener +locals memory namespaces system ui.backend.cocoa +ui.theme.switching ui.tools.browser ui.tools.listener +vocabs.refresh ; FROM: alien.c-types => int void ; IN: ui.backend.cocoa.tools @@ -27,9 +27,9 @@ CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate METHOD: int applicationShouldHandleReopen: id app hasVisibleWindows: int flag [ flag 0 = [ show-listener ] when 1 ] ; - METHOD: id factorListener: id app [ show-listener f ] ; + METHOD: id showFactorListener: id app [ show-listener f ] ; - METHOD: id factorBrowser: id app [ show-browser f ] ; + METHOD: id showFactorBrowser: id app [ show-browser f ] ; METHOD: id newFactorListener: id app [ listener-window f ] ; @@ -41,6 +41,10 @@ CLASS: FactorWorkspaceApplicationDelegate < FactorApplicationDelegate METHOD: id saveFactorImageAs: id app [ menu-save-image f ] ; + METHOD: id switchLightTheme: id app [ light-mode f ] ; + + METHOD: id switchDarkTheme: id app [ dark-mode f ] ; + METHOD: id refreshAll: id app [ [ refresh-all ] \ refresh-all call-listener f ] ; ; diff --git a/basis/ui/gadgets/labels/labels.factor b/basis/ui/gadgets/labels/labels.factor index 998bfb538a..a4fce2cd57 100644 --- a/basis/ui/gadgets/labels/labels.factor +++ b/basis/ui/gadgets/labels/labels.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. 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.tools.common ; +strings ui.baseline-alignment ui.gadgets ui.gadgets.theme +ui.gadgets.tracks ui.pens.solid ui.render ui.text ; IN: ui.gadgets.labels ! A label gadget draws a string. diff --git a/basis/ui/gadgets/line-support/line-support.factor b/basis/ui/gadgets/line-support/line-support.factor index 4b2eb0f699..078c0eb149 100644 --- a/basis/ui/gadgets/line-support/line-support.factor +++ b/basis/ui/gadgets/line-support/line-support.factor @@ -3,7 +3,7 @@ USING: accessors arrays combinators fry kernel math math.functions math.order math.ranges math.vectors namespaces opengl sequences ui.gadgets ui.gadgets.scrollers -ui.gadgets.viewports ui.render ui.text ; +ui.gadgets.viewports ui.render ui.text ui.theme ; IN: ui.gadgets.line-support ! Some code shared by table and editor gadgets diff --git a/basis/ui/gadgets/menus/menus.factor b/basis/ui/gadgets/menus/menus.factor index f660b1dbf1..dba9a9adae 100644 --- a/basis/ui/gadgets/menus/menus.factor +++ b/basis/ui/gadgets/menus/menus.factor @@ -3,8 +3,8 @@ USING: accessors kernel locals math.rectangles math.vectors namespaces opengl sequences sorting ui.commands ui.gadgets ui.gadgets.buttons ui.gadgets.glass ui.gadgets.packs -ui.gadgets.theme ui.gadgets.worlds ui.gestures ui.operations -ui.pens ui.pens.solid ui.tools.common ; +ui.gadgets.worlds ui.gestures ui.operations +ui.pens ui.pens.solid ui.theme ui.tools.common ; IN: ui.gadgets.menus : show-menu ( owner menu -- ) diff --git a/basis/ui/gadgets/panes/panes.factor b/basis/ui/gadgets/panes/panes.factor index e76417ee71..5a706b0c6f 100644 --- a/basis/ui/gadgets/panes/panes.factor +++ b/basis/ui/gadgets/panes/panes.factor @@ -9,7 +9,7 @@ ui.gadgets.icons ui.gadgets.incremental ui.gadgets.labels ui.gadgets.menus ui.gadgets.packs ui.gadgets.paragraphs ui.gadgets.presentations ui.gadgets.private ui.gadgets.scrollers ui.gadgets.tracks ui.gestures ui.images ui.pens.solid ui.render -ui.traverse ; +ui.theme ui.traverse ; FROM: io.styles => foreground background ; FROM: ui.gadgets.wrappers => ; IN: ui.gadgets.panes diff --git a/basis/ui/gadgets/presentations/presentations.factor b/basis/ui/gadgets/presentations/presentations.factor index d542494096..b65ca9d074 100644 --- a/basis/ui/gadgets/presentations/presentations.factor +++ b/basis/ui/gadgets/presentations/presentations.factor @@ -3,8 +3,7 @@ USING: accessors kernel memoize namespaces ui.commands ui.gadgets ui.gadgets.borders ui.gadgets.buttons ui.gadgets.buttons.private ui.gadgets.glass ui.gadgets.menus ui.gadgets.status-bar -ui.gadgets.theme ui.gadgets.worlds ui.gestures -ui.operations ui.pens.solid ; +ui.gadgets.worlds ui.gestures ui.operations ui.pens.solid ui.theme ; IN: ui.gadgets.presentations TUPLE: presentation < button object hook ; diff --git a/basis/ui/gadgets/status-bar/status-bar.factor b/basis/ui/gadgets/status-bar/status-bar.factor index 3e3e603fed..73b763c59f 100644 --- a/basis/ui/gadgets/status-bar/status-bar.factor +++ b/basis/ui/gadgets/status-bar/status-bar.factor @@ -3,7 +3,7 @@ USING: accessors calendar colors.constants fonts kernel models models.arrow models.delay sequences summary ui ui.gadgets.borders ui.gadgets.labels ui.gadgets.tracks -ui.gadgets.theme ui.gadgets.worlds ui.pens.solid ui.private ; +ui.gadgets.worlds ui.pens.solid ui.private ui.theme ; IN: ui.gadgets.status-bar : status-bar-font ( -- font ) diff --git a/basis/ui/gadgets/tables/tables.factor b/basis/ui/gadgets/tables/tables.factor index 5bd9209c88..58252100ef 100644 --- a/basis/ui/gadgets/tables/tables.factor +++ b/basis/ui/gadgets/tables/tables.factor @@ -5,8 +5,8 @@ combinators.short-circuit fonts fry kernel locals math math.functions math.order math.rectangles math.vectors models namespaces opengl sequences splitting strings ui.commands ui.gadgets ui.gadgets.line-support ui.gadgets.menus -ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.theme ui.gadgets.worlds -ui.gestures ui.images ui.pens.solid ui.render ui.text ; +ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.worlds +ui.gestures ui.images ui.pens.solid ui.render ui.text ui.theme ; IN: ui.gadgets.tables ! Row rendererer protocol diff --git a/basis/ui/gadgets/theme/theme.factor b/basis/ui/gadgets/theme/theme.factor index 1a764b9828..bea1fad24b 100644 --- a/basis/ui/gadgets/theme/theme.factor +++ b/basis/ui/gadgets/theme/theme.factor @@ -1,7 +1,10 @@ ! Copyright (C) 2009, 2010 Slava Pestov, Joe Groff. ! See http://factorcode.org/license.txt for BSD license. -USING: io.pathnames sequences ui.images ; +USING: accessors io.pathnames sequences ui.images ui.theme ; IN: ui.gadgets.theme : theme-image ( name -- image-name ) "vocab:ui/gadgets/theme/" prepend-path ".tiff" append ; + +: theme-font-colors ( gadget -- gadget ) + [ content-background >>background text-color >>foreground ] change-font ; diff --git a/basis/ui/theme/switching/switching.factor b/basis/ui/theme/switching/switching.factor index 0afdad0bc9..786ee6e698 100644 --- a/basis/ui/theme/switching/switching.factor +++ b/basis/ui/theme/switching/switching.factor @@ -1,31 +1,57 @@ ! 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.theme ui.tools.listener ; +USING: assocs fry hashtables help.stylesheet help.tips io.styles +kernel listener namespaces prettyprint.stylesheet sequences +ui.theme ui.tools.listener vocabs.prettyprint words ; IN: ui.theme.switching : (update-style) ( style color elt -- ) '[ _ _ rot ?set-at ] change-global ; : update-stylesheet ( -- ) + + ! help.stylesheet default-span-style text-color foreground (update-style) link-style link-color foreground (update-style) title-style title-color foreground (update-style) + help-path-style help-path-border-color table-border (update-style) heading-style heading-color foreground (update-style) snippet-style snippet-color foreground (update-style) code-style code-background-color page-color (update-style) output-style output-color foreground (update-style) - url-style url-color foreground (update-style) + url-style link-color foreground (update-style) warning-style warning-background-color page-color (update-style) - deprecated-style warning-background-color page-color (update-style) - table-style line-color table-border (update-style) - prompt-style prompt-background-color background (update-style) - prompt-style text-color foreground (update-style) + warning-style warning-border-color border-color (update-style) + deprecated-style deprecated-background-color page-color (update-style) + deprecated-style deprecated-border-color border-color (update-style) + table-style table-border-color table-border (update-style) + + ! help.tips tip-of-the-day-style tip-background-color page-color (update-style) + + ! ui.tools.listener listener-input-style text-color foreground (update-style) - listener-word-style text-color foreground (update-style) ; + listener-word-style text-color foreground (update-style) + + ! prettyprint.stylesheet + { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: } + [ "word-style" word-prop [ dim-color foreground ] dip set-at ] each + base-word-style text-color foreground (update-style) + highlighted-word-style highlighted-word-color foreground (update-style) + base-string-style string-color foreground (update-style) + base-vocab-style dim-color foreground (update-style) + stack-effect-style stack-effect-color foreground (update-style) + + ! listener + prompt-style prompt-background-color background (update-style) + prompt-style text-color foreground (update-style) + + ! vocabs.prettyprint + manifest-style vocab-background-color page-color (update-style) + manifest-style vocab-border-color border-color (update-style) ; -: light-mode ( -- ) light-theme theme set-global update-stylesheet ; -: dark-mode ( -- ) dark-theme theme set-global update-stylesheet ; +: light-mode ( -- ) + light-theme theme set-global update-stylesheet ; -light-mode +: dark-mode ( -- ) + dark-theme theme set-global update-stylesheet ; diff --git a/basis/ui/theme/theme.factor b/basis/ui/theme/theme.factor index dbdd5ec37e..de20ca1b7d 100644 --- a/basis/ui/theme/theme.factor +++ b/basis/ui/theme/theme.factor @@ -63,8 +63,12 @@ HOOK: title-color theme ( -- color ) HOOK: heading-color theme ( -- color ) HOOK: snippet-color theme ( -- color ) HOOK: output-color theme ( -- color ) +HOOK: deprecated-background-color theme ( -- color ) +HOOK: deprecated-border-color theme ( -- color ) HOOK: warning-background-color theme ( -- color ) +HOOK: warning-border-color theme ( -- color ) HOOK: code-background-color theme ( -- color ) +HOOK: help-path-border-color theme ( -- color ) HOOK: tip-background-color theme ( -- color ) @@ -86,7 +90,10 @@ HOOK: focus-border-color theme ( -- color ) HOOK: labeled-border-color theme ( -- color ) +HOOK: table-border-color theme ( -- color ) + SINGLETON: light-theme +theme [ light-theme ] initialize M: light-theme toolbar-background COLOR: grey95 ; M: light-theme toolbar-button-pressed-background COLOR: dark-gray ; @@ -141,22 +148,25 @@ M: light-theme content-background COLOR: white ; M: light-theme text-color COLOR: black ; M: light-theme link-color COLOR: DodgerBlue4 ; -M: light-theme url-color COLOR: DodgerBlue4 ; M: light-theme title-color COLOR: gray20 ; M: light-theme heading-color COLOR: FactorDarkSlateBlue ; -M: light-theme snippet-color COLOR: solarized-orange ; -M: light-theme output-color COLOR: solarized-orange ; -M: light-theme warning-background-color T{ rgba f 1 0.7 0.7 1 } ; +M: light-theme snippet-color COLOR: DarkOrange4 ; +M: light-theme output-color COLOR: DarkOrange4 ; +M: light-theme deprecated-background-color COLOR: gray90 ; +M: light-theme deprecated-border-color COLOR: red ; +M: light-theme warning-background-color COLOR: gray90 ; +M: light-theme warning-border-color COLOR: red ; M: light-theme code-background-color COLOR: FactorLightTan ; +M: light-theme help-path-border-color COLOR: FactorLightTan ; M: light-theme tip-background-color COLOR: lavender ; M: light-theme prompt-background-color T{ rgba f 1 0.7 0.7 1 } ; -M: light-theme dim-color COLOR: solarized-cyan ; -M: light-theme highlighted-word-color COLOR: solarized-green ; -M: light-theme string-color COLOR: solarized-magenta ; -M: light-theme stack-effect-color COLOR: solarized-orange ; +M: light-theme dim-color COLOR: gray35 ; +M: light-theme highlighted-word-color COLOR: DarkSlateGray ; +M: light-theme string-color COLOR: LightSalmon4 ; +M: light-theme stack-effect-color COLOR: FactorDarkGreen ; M: light-theme vocab-background-color COLOR: FactorLightTan ; M: light-theme vocab-border-color COLOR: FactorDarkTan ; @@ -169,6 +179,8 @@ M: light-theme focus-border-color COLOR: dark-gray ; M: light-theme labeled-border-color COLOR: grey85 ; +M: light-theme table-border-color COLOR: FactorTan ; + SINGLETON: dark-theme M: dark-theme toolbar-background COLOR: solarized-base02 ; @@ -224,13 +236,16 @@ M: dark-theme content-background COLOR: solarized-base03 ; M: dark-theme text-color COLOR: grey75 ; M: dark-theme link-color COLOR: solarized-blue ; -M: dark-theme url-color COLOR: solarized-blue ; M: dark-theme title-color COLOR: grey75 ; M: dark-theme heading-color COLOR: grey75 ; M: dark-theme snippet-color COLOR: solarized-orange ; M: dark-theme output-color COLOR: solarized-orange ; +M: dark-theme deprecated-background-color HEXCOLOR: 6E2E32 ; +M: dark-theme deprecated-border-color COLOR: red ; M: dark-theme warning-background-color HEXCOLOR: 6E2E32 ; +M: dark-theme warning-border-color COLOR: red ; M: dark-theme code-background-color HEXCOLOR: 2F4D5B ; +M: dark-theme help-path-border-color HEXCOLOR: 2F4D5B ; M: dark-theme tip-background-color HEXCOLOR: 2F4D5B ; @@ -252,4 +267,4 @@ M: dark-theme focus-border-color COLOR: solarized-base01 ; M: dark-theme labeled-border-color COLOR: solarized-base01 ; -light-theme theme set-global +M: dark-theme table-border-color COLOR: solarized-base01 ; diff --git a/basis/ui/tools/browser/browser.factor b/basis/ui/tools/browser/browser.factor index e4ad3dae48..c106a22b95 100644 --- a/basis/ui/tools/browser/browser.factor +++ b/basis/ui/tools/browser/browser.factor @@ -8,10 +8,10 @@ make models namespaces sequences sets ui ui.commands ui.gadgets ui.gadgets.borders ui.gadgets.editors ui.gadgets.editors.private ui.gadgets.glass ui.gadgets.labels ui.gadgets.labels.private ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.status-bar -ui.theme ui.gadgets.toolbar ui.gadgets.tracks +ui.theme ui.gadgets.theme ui.gadgets.toolbar ui.gadgets.tracks ui.gadgets.viewports ui.gadgets.worlds ui.gestures ui.pens.solid -ui.render ui.text ui.tools.browser.history -ui.tools.browser.popups ui.tools.common vocabs ; +ui.render ui.text ui.tools.common ui.tools.browser.history +ui.tools.browser.popups vocabs ; IN: ui.tools.browser TUPLE: browser-gadget < tool history scroller search-field popup ; diff --git a/basis/ui/tools/browser/popups/popups.factor b/basis/ui/tools/browser/popups/popups.factor index d4f01fd795..d2bb6ef48c 100644 --- a/basis/ui/tools/browser/popups/popups.factor +++ b/basis/ui/tools/browser/popups/popups.factor @@ -5,7 +5,7 @@ definitions.icons fry help help.topics kernel math.rectangles models.arrow namespaces sequences tools.crossref ui.gadgets ui.gadgets.glass ui.gadgets.labeled ui.gadgets.search-tables ui.gadgets.tables ui.gadgets.theme ui.gadgets.wrappers ui.gestures ui.images -ui.operations ui.pens.solid ; +ui.operations ui.pens.solid ui.theme ; FROM: ui.gadgets.wrappers => wrapper ; IN: ui.tools.browser.popups diff --git a/basis/ui/tools/common/common.factor b/basis/ui/tools/common/common.factor index 287539c540..9c927a0a15 100644 --- a/basis/ui/tools/common/common.factor +++ b/basis/ui/tools/common/common.factor @@ -49,6 +49,3 @@ SLOT: scroller : white-interior ( track -- track ) content-background >>interior ; - -: theme-font-colors ( gadget -- gadget ) - [ content-background >>background text-color >>foreground ] change-font ; diff --git a/basis/ui/tools/debugger/debugger.factor b/basis/ui/tools/debugger/debugger.factor index 610aa10b6f..f1ec3fb2d7 100644 --- a/basis/ui/tools/debugger/debugger.factor +++ b/basis/ui/tools/debugger/debugger.factor @@ -7,7 +7,7 @@ ui.debugger ui.gestures ui.gadgets ui.pens.solid ui.gadgets.worlds ui.gadgets.packs ui.gadgets.buttons ui.gadgets.labels ui.gadgets.presentations ui.gadgets.panes ui.gadgets.viewports ui.gadgets.tables ui.theme -ui.gadgets.tracks ui.gadgets.toolbar +ui.gadgets.theme ui.gadgets.tracks ui.gadgets.toolbar ui.gadgets.scrollers ui.gadgets.borders ui.gadgets.status-bar ui.tools.traceback ui.tools.inspector ui.tools.browser ui.tools.common ; IN: ui.tools.debugger diff --git a/basis/ui/tools/inspector/inspector.factor b/basis/ui/tools/inspector/inspector.factor index 29b5dbce14..209e0624bf 100644 --- a/basis/ui/tools/inspector/inspector.factor +++ b/basis/ui/tools/inspector/inspector.factor @@ -1,13 +1,14 @@ ! Copyright (C) 2006, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors colors inspector namespaces kernel models fry -colors.constants models.arrow prettyprint sequences mirrors assocs -classes io io.styles arrays hashtables math.order sorting refs fonts -ui.tools.browser ui.commands ui.operations ui.gadgets ui.gadgets.panes -ui.gadgets.scrollers ui.gadgets.slots ui.gadgets.tracks ui.gestures -ui.gadgets.buttons ui.gadgets.tables ui.theme -ui.gadgets.toolbar ui.gadgets.status-bar -ui.gadgets.labeled ui.tools.common ui combinators ui.gadgets.worlds ; +colors.constants models.arrow prettyprint sequences mirrors +assocs classes io io.styles arrays hashtables math.order sorting +refs fonts ui.tools.browser ui.commands ui.operations ui.gadgets +ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.slots +ui.gadgets.theme ui.gadgets.tracks ui.gestures +ui.gadgets.buttons ui.gadgets.tables ui.theme ui.gadgets.toolbar +ui.gadgets.status-bar ui.gadgets.labeled ui.tools.common ui +combinators ui.gadgets.worlds ; IN: ui.tools.inspector TUPLE: inspector-gadget < tool table ; diff --git a/basis/ui/tools/listener/completion/completion.factor b/basis/ui/tools/listener/completion/completion.factor index 47437c6312..d5f4b32143 100644 --- a/basis/ui/tools/listener/completion/completion.factor +++ b/basis/ui/tools/listener/completion/completion.factor @@ -9,7 +9,7 @@ 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.pens.solid ui.theme ui.tools.common ui.tools.listener.history ui.tools.listener.popups vocabs words ; IN: ui.tools.listener.completion diff --git a/basis/ui/tools/listener/listener.factor b/basis/ui/tools/listener/listener.factor index 863e170384..36322b4fc6 100644 --- a/basis/ui/tools/listener/listener.factor +++ b/basis/ui/tools/listener/listener.factor @@ -10,6 +10,7 @@ prettyprint sequences source-files.errors strings system threads tools.errors.model ui ui.commands ui.gadgets ui.gadgets.editors ui.gadgets.glass ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.status-bar ui.theme +ui.gadgets.theme ui.gadgets.toolbar ui.gadgets.tracks ui.gestures ui.operations ui.pens.solid ui.tools.browser ui.tools.common ui.tools.debugger ui.tools.error-list ui.tools.listener.completion diff --git a/basis/ui/tools/traceback/traceback.factor b/basis/ui/tools/traceback/traceback.factor index 9341d96ab4..d2a839ba73 100644 --- a/basis/ui/tools/traceback/traceback.factor +++ b/basis/ui/tools/traceback/traceback.factor @@ -5,7 +5,7 @@ kernel models models.arrow prettyprint sequences ui.commands ui.gadgets ui.gadgets.borders ui.gadgets.buttons ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.tables ui.gadgets.toolbar -ui.theme ui.gadgets.tracks +ui.theme ui.gadgets.theme ui.gadgets.tracks ui.gestures ui.tools.common ; QUALIFIED-WITH: ui.tools.inspector i IN: ui.tools.traceback diff --git a/basis/vocabs/prettyprint/prettyprint.factor b/basis/vocabs/prettyprint/prettyprint.factor index a8c2f80631..6d9ffd1a2a 100644 --- a/basis/vocabs/prettyprint/prettyprint.factor +++ b/basis/vocabs/prettyprint/prettyprint.factor @@ -1,9 +1,8 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays assocs colors fry io -io.styles kernel literals make math.order namespaces parser -prettyprint.backend prettyprint.sections prettyprint.stylesheet -sequences sets sorting ui.theme vocabs vocabs.parser ; +USING: accessors assocs colors.constants fry io io.styles kernel +make namespaces parser prettyprint.backend prettyprint.sections +prettyprint.stylesheet sequences sorting vocabs vocabs.parser ; FROM: io.styles => inset ; IN: vocabs.prettyprint @@ -83,6 +82,12 @@ PRIVATE> : pprint-manifest ( manifest -- ) (pprint-manifest pprint-manifest) ; +CONSTANT: manifest-style H{ + { page-color COLOR: FactorLightTan } + { border-color COLOR: FactorDarkTan } + { inset { 5 5 } } +} + [ nl { { font-style bold } { font-name "sans-serif" } } [ @@ -90,10 +95,6 @@ PRIVATE> "To avoid doing this in the future, add the following forms" print "at the top of the source file:" print nl ] with-style - { - { page-color $ vocab-background-color } - { border-color $ vocab-border-color } - { inset { 5 5 } } - } [ manifest get pprint-manifest ] with-nesting + manifest-style [ manifest get pprint-manifest ] with-nesting nl nl ] print-use-hook set-global