refactoring using centercontainer in button widget

This commit is contained in:
chrox
2013-07-21 14:14:32 +08:00
parent f9344faefe
commit b24db8a1ca

View File

@@ -36,10 +36,12 @@ function Button:init()
background = self.background,
radius = self.radius,
padding = self.padding,
HorizontalGroup:new{
HorizontalSpan:new{ width = (self.width - text_size.w)/2 },
CenterContainer:new{
dimen = Geom:new{
w = self.width,
h = text_size.h
},
self.text_widget,
HorizontalSpan:new{ width = (self.width - text_size.w)/2 },
}
}
if self.preselect then