feat(ui): add reusable on-screen keyboard
This commit is contained in:
@@ -27,6 +27,12 @@ screen:draw()
|
||||
assert(#device.painted == 1 and device.painted[1].label == "a longer label",
|
||||
"changing a button label repainted other components")
|
||||
|
||||
local centred = ui.text("go", {w = 40, text_align = "center"})
|
||||
local centredScreen = ui.screen(ui.box{centred})
|
||||
device.painted = {}
|
||||
centredScreen:draw()
|
||||
assert(device.painted[1].x == 14, "centred text painted at " .. device.painted[1].x)
|
||||
|
||||
-- Fractions resolve against the parent content box, absolutes stay absolute.
|
||||
local half = ui.box{w = 0.5, h = 40}
|
||||
local fixed = ui.box{w = 100, h = 40}
|
||||
|
||||
Reference in New Issue
Block a user