summaryrefslogtreecommitdiff
path: root/tests/ui/hello.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/hello.lua')
-rw-r--r--tests/ui/hello.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/ui/hello.lua b/tests/ui/hello.lua
index 1691d6aee..b24b70e70 100644
--- a/tests/ui/hello.lua
+++ b/tests/ui/hello.lua
@@ -43,7 +43,9 @@ function hello:init()
self:menubar():title_set("Menu Bar (Hello)")
-- add title label
- self:desktop():insert(label:new("title", rect {0, 1, 20, 2}, "hello xmake!"))
+ local title = "hello xmake!"
+ local pos = (self:width() - #title) / 2
+ self:desktop():insert(label:new("title", rect {pos, 0, pos + #title, 1}, title))
end
-- on event