Skip to content

Commit c25c493

Browse files
committed
WIP
1 parent a696242 commit c25c493

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

gui-lib/framework/main.rkt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,14 +2186,15 @@ the color selection buttons all have the same size.
21862186
()
21872187
@{
21882188

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
2189+
Returns @racket[#true] if the current @tech{color scheme} is in dark mode
2190+
(i.e. has a light foreground with a dark background) and
2191+
@racket[#false] if it is in light mode (i.e. a dark foreground with
21912192
a light background).
21922193

21932194
This function uses the @racket['framework:white-on-black-mode?] preference;
21942195
returning its value if it is a boolean and using @racket[white-on-black-panel-scheme?] if
21952196
it is set to @racket['platform]. This function is intended
2196-
to be used in place of@racket[white-on-black-panel-scheme?]
2197+
to be used in place of @racket[white-on-black-panel-scheme?]
21972198
for code that supports @tech{color scheme}s.
21982199

21992200
@history[#:added "1.79"]
@@ -2341,10 +2342,15 @@ for code that supports @tech{color scheme}s.
23412342
color-prefs:set-current-color-scheme
23422343
(-> symbol? void?)
23432344
(name)
2344-
@{Sets
2345-
the current @tech{color scheme} to the scheme named @racket[name],
2346-
if @racket[name] is one of the color schemes.
2347-
Otherwise, sets the color scheme to the default color scheme.})
2345+
@{
2346+
Updates the colors in DrRacket's GUI to the colors in
2347+
the @tech{color scheme} named @racket[name],
2348+
if @racket[name] names one of the color schemes and
2349+
the named color scheme matches the dark/light mode that the GUI is in.
2350+
Otherwise, sets the color scheme to either the
2351+
light or dark mode default color scheme, depending
2352+
on the user's preference for the current mode.
2353+
})
23482354

23492355
(proc-doc
23502356
color-prefs:get-current-color-scheme-name

gui-lib/framework/private/color-prefs.rkt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,9 @@
10471047
'framework:color-scheme-wob
10481048
'framework:color-scheme)
10491049
(color-scheme-name color-scheme))
1050-
(change-colors-to-match-color-scheme color-scheme))
1050+
(when (equal? (color-scheme-white-on-black-base? color-scheme)
1051+
(white-on-black-color-scheme?))
1052+
(change-colors-to-match-color-scheme color-scheme)))
10511053

10521054
(define (change-colors-to-match-color-scheme color-scheme)
10531055
(if (color-scheme-white-on-black-base? color-scheme)

0 commit comments

Comments
 (0)