fixed bug in new font preference handling

svn: r6667
This commit is contained in:
Robby Findler 2007-06-15 19:09:50 +00:00
parent 5d2f4c5a12
commit a87cf03005
2 changed files with 12 additions and 6 deletions

View File

@ -105,14 +105,20 @@
(preferences:set (preferences:set
'framework:standard-style-list:font-name 'framework:standard-style-list:font-name
(list-ref all-faces (car choice)))))])))))] (list-ref all-faces (car choice)))))])))))]
[font-name (preferences:get 'framework:standard-style-list:font-name)]) [font-name (preferences:get 'framework:standard-style-list:font-name)]
[set-choice-selection
(λ (font-name)
(cond
[(send choice find-string font-name)
(send choice set-string-selection font-name)]
[else
(send choice set-selection (- (send choice get-number) 1))]))])
(preferences:add-callback (preferences:add-callback
'framework:standard-style-list:font-name 'framework:standard-style-list:font-name
(λ (p v) (λ (p v)
(when (send choice find-string v) (set-choice-selection v)))
(send choice set-string-selection v)))) (set-choice-selection font-name)
(when (send choice find-string font-name)
(send choice set-string-selection font-name))
choice)] choice)]
[smoothing-contol [smoothing-contol
(new choice% (new choice%

View File

@ -372,7 +372,7 @@
(preferences:add-callback 'framework:standard-style-list:font-name (λ (p v) (set-font-name v))) (preferences:add-callback 'framework:standard-style-list:font-name (λ (p v) (set-font-name v)))
(preferences:add-callback 'framework:standard-style-list:smoothing (λ (p v) (set-font-smoothing v))) (preferences:add-callback 'framework:standard-style-list:smoothing (λ (p v) (set-font-smoothing v)))
(unless (member (preferences:get 'framework:standard-style-list:font-name) (get-face-list 'mono)) (unless (member (preferences:get 'framework:standard-style-list:font-name) (get-face-list))
(preferences:set 'framework:standard-style-list:font-name (get-family-builtin-face 'modern)))) (preferences:set 'framework:standard-style-list:font-name (get-family-builtin-face 'modern))))
;; set-standard-style-list-delta : string (is-a?/c style-delta<%>) -> void ;; set-standard-style-list-delta : string (is-a?/c style-delta<%>) -> void