Clean up raise protocol

This commit is contained in:
Tony Garnock-Jones 2016-09-26 16:10:36 -04:00
parent 0400385142
commit 1e9c90abd7
1 changed files with 4 additions and 4 deletions

View File

@ -73,14 +73,14 @@
))
(render-children)))))
(define (draggable-mixin touching? x y z)
(define (draggable-mixin touching? x y id-to-raise)
(define (idle)
(react (stop-when #:when (touching?)
(message (inbound (mouse-event 'left-down (mouse-state $mx $my _ _ _))))
(dragging (- mx (x)) (- my (y))))))
(define (dragging dx dy)
(z (- (current-inexact-milliseconds)))
(when id-to-raise (send! (raise-widget id-to-raise)))
(react (on (message (inbound (mouse-event 'motion (mouse-state $mx $my _ _ _))))
(x (- mx dx))
(y (- my dy)))
@ -348,12 +348,12 @@
(field [z (- (current-inexact-milliseconds))])
(define/query-value touching-title-bar?
#f (inbound (touching `(,window-id title-bar))) #t)
(on-start (draggable-mixin touching-title-bar? x y z))
(on-start (draggable-mixin touching-title-bar? x y window-id))
(when resizable?
(define/query-value touching-resize-corner?
#f (inbound (touching `(,window-id resize-corner))) #t)
(on-start (draggable-mixin touching-resize-corner? width height z)))
(on-start (draggable-mixin touching-resize-corner? width height window-id)))
(define/query-value touching-close-icon?
#f (inbound (touching `(,window-id close-icon))) #t)