summaryrefslogtreecommitdiff
path: root/lua/backstack.lua
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-11-20 14:43:20 +1100
committerjacqueline <me@jacqueline.id.au>2023-11-20 14:43:20 +1100
commiteffac1917a615660bf76b35b3605ac2d3eeabd2f (patch)
treee078b24b8405203fb36a6f83a7235b05f4bf32a0 /lua/backstack.lua
parentb7f37f6426c78132d338b032962209bd93771039 (diff)
downloadtangara-fw-effac1917a615660bf76b35b3605ac2d3eeabd2f.tar.gz
Use C functions for the backstack, instead of a lua module
Working with the default group and root kinda sucks if you have to do it from lua!
Diffstat (limited to 'lua/backstack.lua')
-rw-r--r--lua/backstack.lua37
1 files changed, 0 insertions, 37 deletions
diff --git a/lua/backstack.lua b/lua/backstack.lua
deleted file mode 100644
index c54fbac4..00000000
--- a/lua/backstack.lua
+++ /dev/null
@@ -1,37 +0,0 @@
-local lvgl = require("lvgl")
-
-local backstack = {
- root = lvgl.Object(nil, {
- w = lvgl.HOR_RES(),
- h = lvgl.VER_RES(),
- }),
- stack = {},
-}
-
-function backstack:Top()
- return self.stack[#self.stack]
-end
-
-function backstack:SetTopParent(parent)
- local top = self:Top()
- if top and top.root then
- top.root:set_parent(parent)
- end
-end
-
-function backstack:Push(screen)
- self:SetTopParent(nil)
- table.insert(self.stack, screen)
- self:SetTopParent(self.root)
-end
-
-function backstack:Pop(num)
- num = num or 1
- for _ = 1, num do
- local removed = table.remove(self.stack)
- removed.root:delete()
- end
- self:SetTopParent(self.root)
-end
-
-return backstack