Opening a second popup if one is already visible hides the first

db4
Slava Pestov 2009-03-13 04:47:56 -05:00
parent 06f29ab7e4
commit da254e4621
1 changed files with 4 additions and 5 deletions

View File

@ -63,7 +63,8 @@ TUPLE: popup < wrapper owner ;
swap >>owner ; inline
M: popup hide-glass-hook
owner>> f >>popup request-focus ;
dup owner>> 2dup popup>> eq?
[ f >>popup request-focus drop ] [ 2drop ] if ;
PRIVATE>
@ -75,7 +76,5 @@ popup H{
popup>> focusable-child resend-gesture ;
: show-popup ( owner popup visible-rect -- )
[ <popup> ] dip
[ drop dup owner>> (>>popup) ]
[ [ [ owner>> ] keep ] dip show-glass ]
2bi ;
[ [ dup dup popup>> [ hide-glass ] when* ] dip <popup> ] dip
[ drop >>popup drop ] [ show-glass ] 3bi ;