From cef7d9e3c86bb7d2140d071c5c236b7203095dd6 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sun, 17 Mar 2013 12:15:21 +0800 Subject: [PATCH] add on tap close to infomessage widget --- frontend/ui/widget/infomessage.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/ui/widget/infomessage.lua b/frontend/ui/widget/infomessage.lua index 9cdbc1c57..d009be423 100644 --- a/frontend/ui/widget/infomessage.lua +++ b/frontend/ui/widget/infomessage.lua @@ -16,6 +16,17 @@ function InfoMessage:init() key_events = { AnyKeyPressed = { { Input.group.Any }, seqtext = "any key", doc = "close dialog" } } + else + self.ges_events.TapClose = { + GestureRange:new{ + ges = "tap", + range = Geom:new{ + x = 0, y = 0, + w = Screen:getWidth(), + h = Screen:getHeight(), + } + } + } end -- we construct the actual content here because self.text is only available now self[1] = CenterContainer:new{ @@ -52,3 +63,7 @@ function InfoMessage:onAnyKeyPressed() return true end +function InfoMessage:onTapClose() + UIManager:close(self) + return true +end