From b24db8a1ca43fd10761d148f68ebfa66bd4686c1 Mon Sep 17 00:00:00 2001 From: chrox Date: Sun, 21 Jul 2013 14:14:32 +0800 Subject: [PATCH] refactoring using centercontainer in button widget --- frontend/ui/widget/button.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/ui/widget/button.lua b/frontend/ui/widget/button.lua index 2ba9321e8..5a8ccc9a5 100644 --- a/frontend/ui/widget/button.lua +++ b/frontend/ui/widget/button.lua @@ -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