Skip to content

Commit c486c83

Browse files
committed
WIP
1 parent 24aa914 commit c486c83

File tree

13 files changed

+251
-111
lines changed

13 files changed

+251
-111
lines changed

gui-doc/scribblings/framework/editor-snip.scrbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434
@defmethod[(get-color) (or/c string? (is-a?/c color%))]{
3535
Returns @racketblock[
36-
(if (preferences:get 'framework:white-on-black?)
36+
(if (color-prefs:white-on-black-color-scheme?)
3737
"white"
3838
"black")]
3939
}

gui-lib/framework/main.rkt

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
(require (for-doc racket/base scribble/manual framework/private/mapdesc
3333
setup/getinfo racket/pretty string-constants
34-
(for-label string-constants racket/pretty)))
34+
(for-label racket/file string-constants racket/pretty)))
3535

3636
(provide-signature-elements
3737
(prefix application: framework:application-class^)
@@ -2069,7 +2069,7 @@ are currently open in tabs.
20692069
void?)
20702070
(pref-sym black-on-white-color white-on-black-color)
20712071
@{Registers a preference whose value will be updated when the user clicks on
2072-
one of the color scheme default settings in the preferences dialog, but
2072+
one of the @tech{color scheme} default settings in the preferences dialog, but
20732073
does not give it a name that can be configured by a color scheme; consider using
20742074
@racket[color-prefs:add-color-scheme-entry] instead.
20752075

@@ -2087,7 +2087,7 @@ are currently open in tabs.
20872087
((white-on-black-color #f)
20882088
(background #f)))
20892089
@{This function registers a color preference but does not give it
2090-
a name that can be configured by a color scheme; consider using
2090+
a name that can be configured by a @tech{color scheme}; consider using
20912091
@racket[color-prefs:add-color-scheme-entry] instead.
20922092

20932093
This function calls @racket[preferences:set-default] and
@@ -2180,6 +2180,25 @@ the color selection buttons all have the same size.
21802180
@{Builds a style delta from its printed representation. Returns @racket[#f]
21812181
if the printed form cannot be parsed.})
21822182

2183+
(proc-doc/names
2184+
color-prefs:white-on-black-color-scheme?
2185+
(-> boolean?)
2186+
()
2187+
@{
2188+
2189+
Returns @racket[#true] if the current @tech{color scheme} is in dark mode (i.e. has a light foreground with
2190+
a dark background) and @racket[#false] if it is in light mode (i.e. a dark foreground with
2191+
a light background).
2192+
2193+
This function uses the @racket['framework:white-on-black-mode?] preference;
2194+
returning its value if it is a boolean and using @racket[white-on-black-panel-scheme?] if
2195+
it is set to @racket['platform]. This function is intended
2196+
to be used in place of@racket[white-on-black-panel-scheme?]
2197+
for code that supports @tech{color scheme}s.
2198+
2199+
@history[#:added "1.79"]
2200+
})
2201+
21832202
(proc-doc/names
21842203
color-prefs:white-on-black
21852204
(-> any)
@@ -2211,7 +2230,7 @@ the color selection buttons all have the same size.
22112230
#f)])
22122231
[result void?])
22132232
(#f #f #f #f #f)
2214-
@{Registers a new color or style named @racket[name] for use in the color schemes.
2233+
@{Registers a new color or style named @racket[name] for use in the @tech{color schemes}.
22152234
If @racket[style] is not @racket[#f], a new style is registered; if not a color is
22162235
registered.
22172236

@@ -2229,7 +2248,7 @@ the color selection buttons all have the same size.
22292248
(() ((extras void)))
22302249
@{Adds a panel for choosing a color-scheme to the preferences dialog.
22312250

2232-
The @racket[extras] argument is called after the color schemes have been added
2251+
The @racket[extras] argument is called after the @tech{color schemes} have been added
22332252
to the preferences panel. It is passed the panel containing the color schemes
22342253
and can add items to it.})
22352254

@@ -2241,7 +2260,7 @@ the color selection buttons all have the same size.
22412260
@index{framework:color-schemes}
22422261
@racket['framework:color-schemes]. Each definition must bind
22432262
a list of hash tables, each of which introduces a new
2244-
color scheme. Each hash table should have keys that specify
2263+
@deftech{color scheme}. Each hash table should have keys that specify
22452264
details of the color scheme, as follows:
22462265
@itemlist[@item{@racket['name]: must be either a string or a symbol;
22472266
it names the entire color scheme.
@@ -2323,21 +2342,21 @@ the color selection buttons all have the same size.
23232342
(-> symbol? void?)
23242343
(name)
23252344
@{Sets
2326-
the current color scheme to the scheme named @racket[name],
2345+
the current @tech{color scheme} to the scheme named @racket[name],
23272346
if @racket[name] is one of the color schemes.
23282347
Otherwise, sets the color scheme to the default color scheme.})
23292348

23302349
(proc-doc
23312350
color-prefs:get-current-color-scheme-name
23322351
(-> symbol?)
2333-
@{Returns the current color scheme's name.})
2352+
@{Returns the current @tech{color scheme}'s name.})
23342353

23352354
(proc-doc/names
23362355
color-prefs:known-color-scheme-name?
23372356
(-> any/c boolean?)
23382357
(name)
23392358
@{Returns @racket[#t] if the input is a @racket[symbol?] that names
2340-
a color or style that is an entry in the current color scheme.
2359+
a color or style that is an entry in the current @tech{color scheme}.
23412360

23422361
In order to return @racket[#t], @racket[name] must have been
23432362
passed as the first argument to @racket[color-prefs:add-color-scheme-entry].})
@@ -2347,7 +2366,7 @@ the color selection buttons all have the same size.
23472366
(-> symbol? (or/c #f symbol?))
23482367
(name)
23492368
@{
2350-
Returns the inverted-base color scheme name
2369+
Returns the inverted-base @tech{color scheme} name
23512370
of color scheme named @racket[name], if it has one.
23522371

23532372
@history[#:added "1.68"]
@@ -2357,7 +2376,7 @@ of color scheme named @racket[name], if it has one.
23572376
color-prefs:color-scheme-style-name?
23582377
(-> any/c boolean?)
23592378
(name)
2360-
@{Returns @racket[#t] if @racket[name] is a known color scheme name,
2379+
@{Returns @racket[#t] if @racket[name] is a known @tech{color scheme} name,
23612380
and is connected to a style.
23622381

23632382
In order to return @racket[#t], @racket[name] must have been
@@ -2368,7 +2387,7 @@ of color scheme named @racket[name], if it has one.
23682387
color-prefs:color-scheme-color-name?
23692388
(-> any/c boolean?)
23702389
(name)
2371-
@{Returns @racket[#t] if @racket[name] is a known color scheme name,
2390+
@{Returns @racket[#t] if @racket[name] is a known @tech{color scheme} name,
23722391
and is connected to a color.
23732392

23742393
In order to return @racket[#t], @racket[name] must have been
@@ -2395,7 +2414,7 @@ of color scheme named @racket[name], if it has one.
23952414
()
23962415
[result void?])
23972416
@{Updates the current color or style delta associated with
2398-
@racket[name] in the current color scheme.})
2417+
@racket[name] in the current @tech{color scheme}.})
23992418

24002419
(proc-doc
24012420
color-prefs:register-color-scheme-entry-change-callback
@@ -2431,8 +2450,8 @@ of color scheme named @racket[name], if it has one.
24312450
(proc-doc
24322451
color-prefs:get-color-scheme-names
24332452
(-> (values set? set?))
2434-
@{Returns two sets; the first is the known color scheme names that are just colors
2435-
and the second is the known color scheme names that are styles.
2453+
@{Returns two sets; the first is the known @tech{color scheme} names that are just colors
2454+
and the second is the known @tech{color scheme} names that are styles.
24362455

24372456
These are all of the names that have been passed to @racket[color-prefs:add-color-scheme-entry].})
24382457
)

0 commit comments

Comments
 (0)