Refactoring.
This commit is contained in:
parent
7b72ddb7bf
commit
d9f97d079f
|
@ -216,9 +216,10 @@
|
|||
(inherit set-show-menu-sort-key get-current-tab
|
||||
get-definitions-text get-interactions-text)
|
||||
|
||||
|
||||
;; view menu
|
||||
(define/public (get-optimization-coach-menu-item)
|
||||
optimization-coach-menu-item)
|
||||
|
||||
(define/override (add-show-menu-items show-menu)
|
||||
(super add-show-menu-items show-menu)
|
||||
(set! optimization-coach-menu-item
|
||||
|
@ -239,13 +240,6 @@
|
|||
(send (send tab get-defs) clear-highlights)
|
||||
(optimization-coach-callback this)))]))
|
||||
(set-show-menu-sort-key optimization-coach-menu-item 403))
|
||||
|
||||
(define/augment (on-tab-change old-tab new-tab)
|
||||
(send old-tab hide-optimization-coach-panel #f) ; don't close it
|
||||
(when (send new-tab optimization-coach-visible?)
|
||||
;; if it was open before
|
||||
(send new-tab show-optimization-coach-panel)))
|
||||
|
||||
(define optimization-coach-menu-item #f)
|
||||
|
||||
|
||||
|
@ -259,6 +253,15 @@
|
|||
menu pos text))
|
||||
(old menu editor event))))
|
||||
|
||||
|
||||
;; tab switching
|
||||
(define/augment (on-tab-change old-tab new-tab)
|
||||
(send old-tab hide-optimization-coach-panel #f) ; don't close it
|
||||
(when (send new-tab optimization-coach-visible?)
|
||||
;; if it was open before
|
||||
(send new-tab show-optimization-coach-panel)))
|
||||
|
||||
|
||||
;; entry point
|
||||
(define/public (optimization-coach-callback)
|
||||
(define definitions (get-definitions-text))
|
||||
|
|
Loading…
Reference in New Issue
Block a user