Permalink
Browse files

mail-ui: Implement a close-if-not-listener (so gadget. works fine).

  • Loading branch information...
mrjbq7 committed Apr 17, 2011
1 parent 1c6136a commit 2e7ea44dcbe9d2357993f0adb1892777d4ace845
Showing with 6 additions and 3 deletions.
  1. +6 −3 mail-ui/mail-ui.factor
View
@@ -5,7 +5,7 @@ USING: accessors arrays colors.constants kernel sequences smtp
splitting ui ui.commands ui.gadgets ui.gadgets.borders
ui.gadgets.buttons ui.gadgets.editors ui.gadgets.labels
ui.gadgets.scrollers ui.gadgets.tracks ui.gestures ui.pens.solid
;
ui.tools.listener ;
IN: mail-ui
@@ -49,15 +49,18 @@ M: mail-gadget focusable-child* to>> ;
: <body> ( mail -- gadget )
body>> <scroller> COLOR: gray <solid> >>boundary ;
: close-if-not-listener ( gadget -- )
dup find-listener [ drop ] [ close-window ] if ;
: com-send ( mail -- )
<email>
over to>> editor-string " " split harvest >>to
over subject>> editor-string >>subject
over body>> editor-string >>body
send-email close-window ;
send-email close-if-not-listener ;
: com-cancel ( mail -- )
close-window ;
close-if-not-listener ;
mail-gadget "toolbar" f {
{ f com-send }

0 comments on commit 2e7ea44

Please sign in to comment.