1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-17 13:48:05 +00:00

ui overhaul

This commit is contained in:
kepler155c@gmail.com
2019-02-05 23:03:57 -05:00
parent 89400ac1bd
commit 915085ac5f
47 changed files with 2879 additions and 3199 deletions

View File

@@ -252,7 +252,7 @@ end
function page.container:setCategory(categoryName, animate)
-- reset the viewport window
self.children = { }
self.offy = 0
self:reset()
local function filter(it, f)
local ot = { }
@@ -334,10 +334,10 @@ function page.container:setCategory(categoryName, animate)
for k,child in ipairs(self.children) do
if r == 1 then
child.x = math.random(1, self.width)
child.y = math.random(1, self.height)
child.y = math.random(1, self.height - 3)
elseif r == 2 then
child.x = self.width
child.y = self.height
child.y = self.height - 3
elseif r == 3 then
child.x = math.floor(self.width / 2)
child.y = math.floor(self.height / 2)
@@ -349,7 +349,7 @@ function page.container:setCategory(categoryName, animate)
child.y = row
if k == #self.children then
child.x = self.width
child.y = self.height
child.y = self.height - 3
end
end
child.tween = Tween.new(6, child, { x = col, y = row }, 'linear')
@@ -369,10 +369,10 @@ function page.container:setCategory(categoryName, animate)
end
self:initChildren()
if animate then -- need to fix transitions under layers
local function transition(args)
if animate then
local function transition()
local i = 1
return function(device)
return function()
self:clear()
for _,child in pairs(self.children) do
child.tween:update(1)
@@ -380,7 +380,6 @@ function page.container:setCategory(categoryName, animate)
child.y = math.floor(child.y)
child:draw()
end
args.canvas:blit(device, args, args)
i = i + 1
return i < 7
end