Window list widgetry

This commit is contained in:
Tony Garnock-Jones 2016-09-26 16:02:46 -04:00
parent 3c57b71ed2
commit 0400385142
1 changed files with 16 additions and 0 deletions

16
gui.rkt
View File

@ -500,6 +500,22 @@
(on (message (button-click 'start-button (mouse-state $mx $my _ _ _)))
(send! (pop-up-menu-trigger 'system-menu mx my 0 1 'left-up)))))
(actor #:name 'window-list-monitor
(during/actor (window-state $id $title _)
(field [x 0] [y 0])
(define reqsize
(parameterize ((theme-button-y-padding 8)
(theme-button-min-height 0)
(theme-button-background-color (hsv->color 240 1 0.6)))
(pushbutton title x y #:id (list 'window-list id) #:parent 'toolbar
#:trigger-event 'left-down)))
(during (layout-solution 'toolbar (horizontal-layout `(-5.0 ,id)) reqsize
(rectangle $l $t $w $h))
(x l)
(y t)
(on (message (button-click (list 'window-list id) _))
(send! (raise-widget id))))))
(actor #:name 'clock
(field [now (current-seconds)])
(on (message (inbound (frame-event _ $timestamp _ _)))