Fixes circularity and adds theme switching to Mac menu.
Could use some simplification and reduction in color theme hooks.
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBClasses</key>
- <array>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>factorBrowser</key>
- <string>id</string>
- <key>factorListener</key>
- <string>id</string>
- <key>newFactorBrowser</key>
- <string>id</string>
- <key>newFactorListener</key>
- <string>id</string>
- <key>refreshAll</key>
- <string>id</string>
- <key>runFactorFile</key>
- <string>id</string>
- <key>saveFactorImage</key>
- <string>id</string>
- <key>saveFactorImageAs</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>FirstResponder</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- </array>
- <key>IBVersion</key>
- <string>1</string>
-</dict>
-</plist>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+ <dependencies>
+ <deployment version="1050" identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
+ </dependencies>
+ <objects>
+ <customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/>
+ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+ <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+ <menu title="Factor.app:Contents:Resources:English.lproj:MenuBar" systemMenu="main" id="29" userLabel="MainMenu">
+ <items>
+ <menuItem title="Factor" id="56">
+ <menu key="submenu" title="Factor" systemMenu="apple" id="57">
+ <items>
+ <menuItem title="About Factor" id="58">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <connections>
+ <action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="236">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
+ <menuItem title="Run Factor Source…" keyEquivalent="o" id="366">
+ <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+ <connections>
+ <action selector="runFactorFile:" target="-1" id="rgF-Ks-Gn8"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Save Factor Image" keyEquivalent="s" id="368">
+ <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+ <connections>
+ <action selector="saveFactorImage:" target="-1" id="Iu7-Jk-Gn3"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Save Factor Image As…" keyEquivalent="S" id="369">
+ <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+ <connections>
+ <action selector="saveFactorImageAs:" target="-1" id="YdH-jx-wV1"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="365"/>
+ <menuItem title="Services" id="131">
+ <menu key="submenu" title="Services" systemMenu="services" id="130"/>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="144">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
+ <menuItem title="Hide Factor" keyEquivalent="h" id="134">
+ <connections>
+ <action selector="hide:" target="-2" id="152"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Hide Others" keyEquivalent="h" id="145">
+ <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+ <connections>
+ <action selector="hideOtherApplications:" target="-2" id="146"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Show All" id="150">
+ <connections>
+ <action selector="unhideAllApplications:" target="-2" id="153"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="149">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
+ <menuItem title="Quit Factor" keyEquivalent="q" id="136">
+ <connections>
+ <action selector="terminate:" target="-2" id="139"/>
+ </connections>
+ </menuItem>
+ </items>
+ </menu>
+ </menuItem>
+ <menuItem title="File" id="343">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <menu key="submenu" title="File" id="344">
+ <items>
+ <menuItem title="New" keyEquivalent="n" id="345">
+ <connections>
+ <action selector="newDocument:" target="-1" id="358"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Open…" keyEquivalent="o" id="346">
+ <connections>
+ <action selector="openDocument:" target="-1" id="359"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="348"/>
+ <menuItem title="Close" keyEquivalent="w" id="349">
+ <connections>
+ <action selector="performClose:" target="-1" id="360"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Save" keyEquivalent="s" id="350">
+ <connections>
+ <action selector="saveDocument:" target="-1" id="361"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Save As…" keyEquivalent="S" id="351">
+ <connections>
+ <action selector="saveDocumentAs:" target="-1" id="362"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Revert" id="352">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <connections>
+ <action selector="revertDocumentToSaved:" target="-1" id="363"/>
+ </connections>
+ </menuItem>
+ </items>
+ </menu>
+ </menuItem>
+ <menuItem title="Edit" id="304">
+ <menu key="submenu" title="Edit" id="305">
+ <items>
+ <menuItem title="Undo" keyEquivalent="z" id="306">
+ <connections>
+ <action selector="undo:" target="-1" id="332"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Redo" keyEquivalent="Z" id="307">
+ <connections>
+ <action selector="redo:" target="-1" id="333"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="308">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
+ <menuItem title="Cut" keyEquivalent="x" id="309">
+ <connections>
+ <action selector="cut:" target="-1" id="341"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Copy" keyEquivalent="c" id="310">
+ <connections>
+ <action selector="copy:" target="-1" id="335"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Paste" keyEquivalent="v" id="311">
+ <connections>
+ <action selector="paste:" target="-1" id="336"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Delete" id="313">
+ <connections>
+ <action selector="delete:" target="-1" id="337"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Select All" keyEquivalent="a" id="314">
+ <connections>
+ <action selector="selectAll:" target="-1" id="338"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="315">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
+ <menuItem title="Find" id="316">
+ <menu key="submenu" title="Find" id="326">
+ <items>
+ <menuItem title="Find…" tag="1" keyEquivalent="f" id="327"/>
+ <menuItem title="Find Next" tag="2" keyEquivalent="g" id="328"/>
+ <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="329"/>
+ <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="330"/>
+ <menuItem title="Jump to Selection" keyEquivalent="j" id="331"/>
+ </items>
+ </menu>
+ </menuItem>
+ <menuItem title="Spelling" id="317">
+ <menu key="submenu" title="Spelling" id="322">
+ <items>
+ <menuItem title="Spelling…" keyEquivalent=":" id="323"/>
+ <menuItem title="Check Spelling" keyEquivalent=";" id="324"/>
+ <menuItem title="Check Spelling as You Type" id="325"/>
+ </items>
+ </menu>
+ </menuItem>
+ <menuItem title="Speech" id="318">
+ <menu key="submenu" title="Speech" id="319">
+ <items>
+ <menuItem title="Start Speaking" id="320"/>
+ <menuItem title="Stop Speaking" id="321"/>
+ </items>
+ </menu>
+ </menuItem>
+ </items>
+ </menu>
+ </menuItem>
+ <menuItem title="Tools" id="283">
+ <menu key="submenu" title="Tools" id="284">
+ <items>
+ <menuItem title="Show Listener" keyEquivalent="l" id="286">
+ <connections>
+ <action selector="showFactorListener:" target="-1" id="r8I-gi-bmO"/>
+ </connections>
+ </menuItem>
+ <menuItem title="New Listener" keyEquivalent="L" id="287">
+ <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
+ <connections>
+ <action selector="newFactorListener:" target="-1" id="7yk-oP-H5Z"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="290">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
+ <menuItem title="Show Browser" keyEquivalent="b" id="288">
+ <connections>
+ <action selector="showFactorBrowser:" target="-1" id="g0e-dO-s7I"/>
+ </connections>
+ </menuItem>
+ <menuItem title="New Browser" keyEquivalent="B" id="289">
+ <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
+ <connections>
+ <action selector="newFactorBrowser:" target="-1" id="cLP-Ug-xfc"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="PMQ-EN-0tV">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
+ <menuItem title="Switch Theme" id="Wvq-ot-R3p">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <menu key="submenu" title="Switch Theme" id="HqQ-K2-6Sn">
+ <items>
+ <menuItem title="Light" id="dSP-rb-Ak9">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <connections>
+ <action selector="switchLightTheme:" target="-1" id="Y29-I0-nL0"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Dark" id="hBk-Ue-CIf">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <connections>
+ <action selector="switchDarkTheme:" target="-1" id="2ug-u3-tEU"/>
+ </connections>
+ </menuItem>
+ </items>
+ </menu>
+ </menuItem>
+ </items>
+ </menu>
+ </menuItem>
+ <menuItem title="Window" id="19">
+ <menu key="submenu" title="Window" systemMenu="window" id="24">
+ <items>
+ <menuItem title="Minimize" keyEquivalent="m" id="23">
+ <connections>
+ <action selector="performMiniaturize:" target="-1" id="37"/>
+ </connections>
+ </menuItem>
+ <menuItem title="Zoom" id="239">
+ <connections>
+ <action selector="performZoom:" target="-1" id="240"/>
+ </connections>
+ </menuItem>
+ <menuItem isSeparatorItem="YES" id="92">
+ <modifierMask key="keyEquivalentModifierMask" command="YES"/>
+ </menuItem>
+ <menuItem title="Bring All to Front" id="5">
+ <connections>
+ <action selector="arrangeInFront:" target="-1" id="39"/>
+ </connections>
+ </menuItem>
+ </items>
+ </menu>
+ </menuItem>
+ <menuItem title="Help" id="103">
+ <menu key="submenu" title="Help" id="106">
+ <items>
+ <menuItem title="Factor Help" keyEquivalent="?" id="111">
+ <connections>
+ <action selector="showFactorBrowser:" target="-1" id="Ddd-ic-q9J"/>
+ </connections>
+ </menuItem>
+ </items>
+ </menu>
+ </menuItem>
+ </items>
+ </menu>
+ </objects>
+</document>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBFramework Version</key>
- <string>677</string>
- <key>IBOldestOS</key>
- <integer>5</integer>
- <key>IBOpenObjects</key>
- <array/>
- <key>IBSystem Version</key>
- <string>9J61</string>
- <key>targetFramework</key>
- <string>IBCocoaFramework</string>
-</dict>
-</plist>
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
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
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 } "." ;
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" } }
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
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.
! 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
<PRIVATE
{ POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: }
[
- { { foreground $ dim-color } }
+ { { foreground COLOR: gray35 } }
"word-style" set-word-prop
] each
PRIVATE>
+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! ;
-<PRIVATE
+SYMBOL: highlighted-word-style
+H{
+ { foreground COLOR: DarkSlateGray }
+} highlighted-word-style set-global
-: colored-presentation-style ( obj color -- style )
- 2 <hashtable> [
- [ 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 ;
! 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
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 ] ;
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 ] ;
;
! 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.
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
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 -- )
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 => <wrapper> ;
IN: ui.gadgets.panes
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 ;
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 )
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
! 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 <image-name> ;
+
+: theme-font-colors ( gadget -- gadget )
+ [ content-background >>background text-color >>foreground ] change-font ;
! 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 ;
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 )
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 ;
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 ;
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 ;
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 ;
M: dark-theme labeled-border-color COLOR: solarized-base01 ;
-light-theme theme set-global
+M: dark-theme table-border-color COLOR: solarized-base01 ;
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 ;
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
: white-interior ( track -- track )
content-background <solid> >>interior ;
-
-: theme-font-colors ( gadget -- gadget )
- [ content-background >>background text-color >>foreground ] change-font ;
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
! 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 ;
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
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
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
! 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
: 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" } } [
"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