1aa3a59ca9
The firmware knew where apps, data and modules lived, called four globals, and painted a status bar into a strip it clipped every app out of. None of that was its business, and the viewport made the bar something an app could neither compose with nor replace. It now loads one file. main.lua mounts the route inside its own node tree, so the bar is a sibling of the app rather than chrome painted over it: one layout, one hit test, no inset arithmetic and no invalidation flags on the C++ side. Apps and main.lua are tables -- they share a lua_State, so globals would collide -- and a screen changes by rebuilding from node().
24 lines
985 B
Lua
24 lines
985 B
Lua
-- Run: lua test/settings_busy.lua
|
|
-- The scan and keyboard screens announce themselves before work that blocks the loop for
|
|
-- seconds. on_tick runs before draw in the same pass, so anything left for draw() to paint
|
|
-- appears only after the blocking call returns -- on a panel ui.screen() has already
|
|
-- cleared. These assert the announcement is built and painted by the tap itself.
|
|
--
|
|
-- Where the notice lands is layout: test/ui_layout_test.cpp asserts centring against the
|
|
-- same C++ the panel runs.
|
|
package.path = "sdcard/.lua/lib/?.lua;test/?.lua;" .. package.path
|
|
|
|
local device = require("fake_device").install()
|
|
|
|
device.start "sdcard/.lua/apps/Settings/main.lua"
|
|
device.tap "WiFi"
|
|
|
|
local drawnBefore = device.drawn
|
|
device.tap "scan networks"
|
|
|
|
-- Built and drawn by the tap, with no draw() in between.
|
|
assert(device.labelled "scanning", "the scan screen did not build its notice")
|
|
assert(device.drawn > drawnBefore, "the scan notice was left for the next draw()")
|
|
|
|
print "ok"
|