adjusted the color preferences button placement to avoid such a wide prefs dialog

original commit: fe75ed9a396c295c6c3a693ad17a64fed739a104
This commit is contained in:
Robby Findler 2011-03-26 10:52:50 -05:00
parent 336a550a1e
commit ac0e37e0e1

View File

@ -28,6 +28,7 @@
(define hp (new horizontal-panel% (define hp (new horizontal-panel%
[parent parent] [parent parent]
[style '(border)] [style '(border)]
[alignment '(center top)]
[stretchable-height #f])) [stretchable-height #f]))
(define e (new (class standard-style-list-text% (define e (new (class standard-style-list-text%
@ -43,6 +44,7 @@
[parent hp] [parent hp]
[min-width 150] [min-width 150]
[editor e] [editor e]
[stretchable-height #t]
[style '(hide-hscroll hide-vscroll)])) [style '(hide-hscroll hide-vscroll)]))
(define (make-check name on off) (define (make-check name on off)
@ -118,13 +120,22 @@
(list-ref smoothing-options (list-ref smoothing-options
(send c get-selection))))))])) (send c get-selection))))))]))
(define fore/back-panel
(and background?
(new vertical-pane%
[parent hp]
[stretchable-width #f]
[stretchable-height #f])))
(define foreground-color-button (define foreground-color-button
(and (>= (get-display-depth) 8) (and (>= (get-display-depth) 8)
(new button% (new button%
[label (if background? [label (if background?
(string-constant cs-foreground-color) (string-constant cs-foreground-color)
(string-constant cs-change-color))] (string-constant cs-change-color))]
[parent hp] [parent (if background?
fore/back-panel
hp)]
[callback [callback
(λ (color-button evt) (λ (color-button evt)
(let* ([add (send (preferences:get pref-sym) get-foreground-add)] (let* ([add (send (preferences:get pref-sym) get-foreground-add)]
@ -146,7 +157,9 @@
background? background?
(new button% (new button%
[label (string-constant cs-background-color)] [label (string-constant cs-background-color)]
[parent hp] [parent (if background?
fore/back-panel
hp)]
[callback [callback
(λ (color-button evt) (λ (color-button evt)
(let* ([add (send (preferences:get pref-sym) get-background-add)] (let* ([add (send (preferences:get pref-sym) get-background-add)]