feat(ui): add reusable on-screen keyboard

This commit is contained in:
2026-08-02 16:07:10 -04:00
parent b2f58118e1
commit 6b6280b72a
14 changed files with 377 additions and 102 deletions
+6
View File
@@ -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}