adjust online expansion so that the space for the error messages doesn't
automatically go away, but instead just becomes empty (and requires a click on a close button to go away) so that there is less bouncing around
This commit is contained in:
parent
b1ecffe262
commit
d4f3fe4442
|
@ -18,6 +18,7 @@
|
||||||
planet/config
|
planet/config
|
||||||
setup/dirs
|
setup/dirs
|
||||||
racket/place
|
racket/place
|
||||||
|
mrlib/close-icon
|
||||||
"tooltip.rkt"
|
"tooltip.rkt"
|
||||||
"drsig.rkt"
|
"drsig.rkt"
|
||||||
"rep.rkt"
|
"rep.rkt"
|
||||||
|
@ -817,6 +818,7 @@
|
||||||
(define expand-error-button-parent-panel #f)
|
(define expand-error-button-parent-panel #f)
|
||||||
(define expand-error-single-child #f)
|
(define expand-error-single-child #f)
|
||||||
(define expand-error-multiple-child #f)
|
(define expand-error-multiple-child #f)
|
||||||
|
(define expand-error-zero-child #f)
|
||||||
|
|
||||||
;; colors : (or/c #f (listof string?) 'parens)
|
;; colors : (or/c #f (listof string?) 'parens)
|
||||||
(define colors #f)
|
(define colors #f)
|
||||||
|
@ -837,7 +839,7 @@
|
||||||
[stretchable-width #t]
|
[stretchable-width #t]
|
||||||
[msg "hi"]))
|
[msg "hi"]))
|
||||||
(set! expand-error-button-parent-panel
|
(set! expand-error-button-parent-panel
|
||||||
(new vertical-panel%
|
(new panel:single%
|
||||||
[stretchable-width #f]
|
[stretchable-width #f]
|
||||||
[stretchable-height #f]
|
[stretchable-height #f]
|
||||||
[parent expand-error-panel]))
|
[parent expand-error-panel]))
|
||||||
|
@ -850,6 +852,8 @@
|
||||||
[callback (λ (b evt) (send (send (get-current-tab) get-defs) expand-error-next))]))
|
[callback (λ (b evt) (send (send (get-current-tab) get-defs) expand-error-next))]))
|
||||||
(set! expand-error-multiple-child
|
(set! expand-error-multiple-child
|
||||||
(new horizontal-panel% [parent expand-error-button-parent-panel]))
|
(new horizontal-panel% [parent expand-error-button-parent-panel]))
|
||||||
|
(set! expand-error-zero-child
|
||||||
|
(new horizontal-panel% [parent expand-error-button-parent-panel]))
|
||||||
(new button%
|
(new button%
|
||||||
[label "<"]
|
[label "<"]
|
||||||
[font small-control-font]
|
[font small-control-font]
|
||||||
|
@ -863,7 +867,12 @@
|
||||||
[font small-control-font]
|
[font small-control-font]
|
||||||
[callback (λ (b evt) (send (send (get-current-tab) get-defs) expand-error-next))]
|
[callback (λ (b evt) (send (send (get-current-tab) get-defs) expand-error-next))]
|
||||||
[parent expand-error-multiple-child])
|
[parent expand-error-multiple-child])
|
||||||
(send expand-error-button-parent-panel change-children (λ (l) (list expand-error-single-child)))
|
(new close-icon%
|
||||||
|
[parent expand-error-panel]
|
||||||
|
[callback
|
||||||
|
(λ ()
|
||||||
|
(send expand-error-parent-panel change-children
|
||||||
|
(λ (l) (remq expand-error-panel l))))])
|
||||||
(send expand-error-parent-panel change-children (λ (l) (remq expand-error-panel l)))
|
(send expand-error-parent-panel change-children (λ (l) (remq expand-error-panel l)))
|
||||||
root)
|
root)
|
||||||
|
|
||||||
|
@ -880,16 +889,14 @@
|
||||||
(send expand-error-message set-msg expand-error-msg)
|
(send expand-error-message set-msg expand-error-msg)
|
||||||
(send expand-error-parent-panel change-children
|
(send expand-error-parent-panel change-children
|
||||||
(λ (l) (append (remq expand-error-panel l) (list expand-error-panel))))
|
(λ (l) (append (remq expand-error-panel l) (list expand-error-panel))))
|
||||||
(send expand-error-button-parent-panel change-children
|
(send expand-error-button-parent-panel active-child
|
||||||
(λ (l) (cond
|
(cond
|
||||||
[(= srcloc-count 0) '()]
|
[(= srcloc-count 0) expand-error-zero-child]
|
||||||
[(= srcloc-count 1)
|
[(= srcloc-count 1) expand-error-single-child]
|
||||||
(list expand-error-single-child)]
|
[else expand-error-multiple-child]))]
|
||||||
[else
|
|
||||||
(list expand-error-multiple-child)])))]
|
|
||||||
[else
|
[else
|
||||||
(send expand-error-parent-panel change-children
|
(send expand-error-message set-msg "")
|
||||||
(λ (l) (remq expand-error-panel l)))])))
|
(send expand-error-button-parent-panel active-child expand-error-zero-child)])))
|
||||||
|
|
||||||
(define/augment (on-tab-change from-tab to-tab)
|
(define/augment (on-tab-change from-tab to-tab)
|
||||||
(send (send to-tab get-defs) restart-place)
|
(send (send to-tab get-defs) restart-place)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user