Merge branch 'main' into themes
This commit is contained in:
+33
-32
@@ -5,41 +5,42 @@ local backstack = require("backstack")
|
||||
local browser = require("browser")
|
||||
local playing = require("playing")
|
||||
local styles = require("styles")
|
||||
local screen = require("screen")
|
||||
|
||||
return function()
|
||||
local menu = widgets.MenuScreen({})
|
||||
return screen:new {
|
||||
createUi = function()
|
||||
local menu = widgets.MenuScreen({})
|
||||
|
||||
menu.list = lvgl.List(menu.root, {
|
||||
w = lvgl.PCT(100),
|
||||
h = lvgl.PCT(100),
|
||||
flex_grow = 1,
|
||||
})
|
||||
menu.list = lvgl.List(menu.root, {
|
||||
w = lvgl.PCT(100),
|
||||
h = lvgl.PCT(100),
|
||||
flex_grow = 1,
|
||||
})
|
||||
|
||||
local now_playing = menu.list:add_btn(nil, "Now Playing")
|
||||
now_playing:onClicked(function()
|
||||
backstack.push(playing)
|
||||
end)
|
||||
now_playing:add_style(styles.list_item)
|
||||
|
||||
local indexes = database.indexes()
|
||||
for _, idx in ipairs(indexes) do
|
||||
local btn = menu.list:add_btn(nil, tostring(idx))
|
||||
btn:onClicked(function()
|
||||
backstack.push(function()
|
||||
return browser {
|
||||
title = tostring(idx),
|
||||
iterator = idx:iter()
|
||||
}
|
||||
end)
|
||||
local now_playing = menu.list:add_btn(nil, "Now Playing")
|
||||
now_playing:onClicked(function()
|
||||
backstack.push(playing:new())
|
||||
end)
|
||||
btn:add_style(styles.list_item)
|
||||
end
|
||||
now_playing:add_style(styles.list_item)
|
||||
|
||||
local settings = menu.list:add_btn(nil, "Settings")
|
||||
settings:onClicked(function()
|
||||
backstack.push(require("settings").root)
|
||||
end)
|
||||
settings:add_style(styles.list_item)
|
||||
local indexes = database.indexes()
|
||||
for _, idx in ipairs(indexes) do
|
||||
local btn = menu.list:add_btn(nil, tostring(idx))
|
||||
btn:onClicked(function()
|
||||
backstack.push(browser:new {
|
||||
title = tostring(idx),
|
||||
iterator = idx:iter(),
|
||||
})
|
||||
end)
|
||||
btn:add_style(styles.list_item)
|
||||
end
|
||||
|
||||
return menu
|
||||
end
|
||||
local settings = menu.list:add_btn(nil, "Settings")
|
||||
settings:onClicked(function()
|
||||
backstack.push(require("settings"):new())
|
||||
end)
|
||||
settings:add_style(styles.list_item)
|
||||
|
||||
return menu
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user