refactoring using updated dimen

pull/164/head
chrox 11 years ago
parent e8cfeb979c
commit f9344faefe

@ -462,27 +462,17 @@ function ConfigDialog:updateConfigPanel(index)
end end
function ConfigDialog:makeDialog() function ConfigDialog:makeDialog()
local dialog = VerticalGroup:new{ self.dialog_frame = FrameContainer:new{
self.config_panel, background = 0,
self.config_menubar, VerticalGroup:new{
self.config_panel,
self.config_menubar,
},
} }
local dialog_size = dialog:getSize()
self[1] = BottomContainer:new{ self[1] = BottomContainer:new{
dimen = Screen:getSize(), dimen = Screen:getSize(),
FrameContainer:new{ self.dialog_frame,
dimen = dialog_size,
background = 0,
dialog,
}
}
self.dialog_dimen = Geom:new{
x = (Screen:getWidth() - dialog_size.w)/2,
y = Screen:getHeight() - dialog_size.h,
w = dialog_size.w,
h = dialog_size.h,
} }
end end
@ -514,7 +504,7 @@ function ConfigDialog:closeDialog()
end end
function ConfigDialog:onTapCloseMenu(arg, ges_ev) function ConfigDialog:onTapCloseMenu(arg, ges_ev)
if ges_ev.pos:notIntersectWith(self.dialog_dimen) then if ges_ev.pos:notIntersectWith(self.dialog_frame.dimen) then
self:closeDialog() self:closeDialog()
return true return true
end end

Loading…
Cancel
Save