diff --git a/library/ui/gadgets/menus.factor b/library/ui/gadgets/menus.factor index 72f4f79345..20361c8f83 100644 --- a/library/ui/gadgets/menus.factor +++ b/library/ui/gadgets/menus.factor @@ -29,5 +29,4 @@ M: menu-glass layout* gadget-child prefer ; } set-gestures : show-menu ( gadget owner -- ) - find-world [ ] keep [ show-glass ] keep - t menu-mode? set-global ; + find-world [ ] keep show-glass ; diff --git a/library/ui/gadgets/presentations.factor b/library/ui/gadgets/presentations.factor index 7bf74c93a9..fd7f93c753 100644 --- a/library/ui/gadgets/presentations.factor +++ b/library/ui/gadgets/presentations.factor @@ -40,7 +40,7 @@ C: presentation ( gadget object -- button ) [ ] map-with make-pile 1 over set-pack-fill ; -: operations-menu ( presentation -- gadget ) +: operations-menu ( presentation -- ) dup presentation-object dup object-operations swap show-menu ; @@ -58,7 +58,7 @@ presentation H{ ] dup reverse-video-theme ; : ( gadget quot -- button ) - [ call-listener ] curry ; + [ call-listener drop ] curry ; ! Character styles diff --git a/library/ui/gestures.factor b/library/ui/gestures.factor index 7c470ee943..d679749609 100644 --- a/library/ui/gestures.factor +++ b/library/ui/gestures.factor @@ -168,8 +168,7 @@ SYMBOL: double-click-timeout : update-clicked ( -- ) hand-gadget get-global hand-clicked set-global - hand-loc get-global hand-click-loc set-global - millis hand-last-time set-global ; + hand-loc get-global hand-click-loc set-global ; : under-hand ( -- seq ) #! A sequence whose first element is the world and last is @@ -188,6 +187,7 @@ SYMBOL: double-click-timeout dup button-down-# dup update-click# dup hand-last-button set-global + millis hand-last-time set-global update-clicked hand-buttons get-global push button-gesture ; diff --git a/library/ui/world.factor b/library/ui/world.factor index ac752d839a..7e59b5b2e8 100644 --- a/library/ui/world.factor +++ b/library/ui/world.factor @@ -75,6 +75,8 @@ M: world layout* >r dup rect-dim r> set-layout-dim ] when* drop ; +M: world children-on nip gadget-children ; + : hide-glass ( world -- ) f menu-mode? set-global dup world-glass [ unparent ] when* @@ -83,4 +85,5 @@ M: world layout* : show-glass ( gadget world -- ) [ hide-glass ] keep [ add-gadget ] 2keep - set-world-glass ; + set-world-glass + t menu-mode? set-global ;