|
1263 | 1263 | (define check-box |
1264 | 1264 | (new check-box% |
1265 | 1265 | [label (if (color-scheme-white-on-black-base? color-scheme) |
1266 | | - "Dark Mode Color Scheme" |
1267 | | - "Light Mode Color Scheme")] |
| 1266 | + (string-constant dark-mode-color-scheme) |
| 1267 | + (string-constant light-mode-color-scheme))] |
1268 | 1268 | [parent bp] |
1269 | 1269 | [value (equal? |
1270 | 1270 | (preferences:get (if (color-scheme-white-on-black-base? color-scheme) |
|
1285 | 1285 | (equal? val (color-scheme-name color-scheme))))) |
1286 | 1286 | (update-colors #f) |
1287 | 1287 | msg)) |
| 1288 | + (define bottom-hp |
| 1289 | + (new horizontal-panel% |
| 1290 | + [parent vp] |
| 1291 | + [stretchable-height #f])) |
1288 | 1292 | (define revert-button% |
1289 | 1293 | (new button% |
1290 | | - [label "Revert Colors to Color Scheme’s Default Colors"] |
1291 | | - [parent vp] |
| 1294 | + [label (string-constant revert-colors-to-color-scheme-defaults)] |
| 1295 | + [parent bottom-hp] |
1292 | 1296 | [callback |
1293 | 1297 | (λ (x y) |
1294 | 1298 | (revert-to-color-scheme-defaults |
1295 | 1299 | (get-current-color-scheme |
1296 | 1300 | #:wob? |
1297 | 1301 | (white-on-black-panel-scheme?))))])) |
| 1302 | + (define white-on-black-mode-choice |
| 1303 | + (case (system-type) |
| 1304 | + [(windows) |
| 1305 | + (new choice% |
| 1306 | + [parent bottom-hp] |
| 1307 | + [label (string-constant color-mode)] |
| 1308 | + [choices (list (string-constant light-mode) |
| 1309 | + (string-constant dark-mode))] |
| 1310 | + [selection (if (preferences:get 'framework:white-on-black-mode?) 1 0)] |
| 1311 | + [callback |
| 1312 | + (λ (_1 _2) |
| 1313 | + (preferences:set 'framework:white-on-black-mode? |
| 1314 | + (match (send white-on-black-mode-choice get-selection) |
| 1315 | + [0 #f] |
| 1316 | + [1 #t])))]) |
| 1317 | + (preferences:add-callback |
| 1318 | + 'framework:white-on-black-mode? |
| 1319 | + (λ (_1 val) |
| 1320 | + (send white-on-black-mode-choice |
| 1321 | + set-selection |
| 1322 | + (if val 1 0))))] |
| 1323 | + [else |
| 1324 | + (new choice% |
| 1325 | + [parent bottom-hp] |
| 1326 | + [label (string-constant color-mode)] |
| 1327 | + [choices (list (string-constant use-os-dark-mode-selection) |
| 1328 | + (string-constant always-light-mode) |
| 1329 | + (string-constant always-dark-mode))] |
| 1330 | + [callback |
| 1331 | + (λ (_1 _2) |
| 1332 | + (preferences:set 'framework:white-on-black-mode? |
| 1333 | + (match (send white-on-black-mode-choice get-selection) |
| 1334 | + [0 'platform] |
| 1335 | + [1 #f] |
| 1336 | + [2 #t])))]) |
| 1337 | + (preferences:add-callback |
| 1338 | + 'framework:white-on-black-mode? |
| 1339 | + (λ (_1 val) |
| 1340 | + (send white-on-black-mode-choice |
| 1341 | + set-selection |
| 1342 | + (match val |
| 1343 | + ['platform 0] |
| 1344 | + [#t 2] |
| 1345 | + [#f 1]))))])) |
1298 | 1346 | (define wid (apply max (map (λ (x) (send x get-width)) buttons))) |
1299 | 1347 | (for ([b (in-list buttons)]) |
1300 | 1348 | (send b min-width wid)) |
|
0 commit comments