WIP: Getting styles from lua

This commit is contained in:
ailurux
2024-03-07 12:12:32 +11:00
parent 490b067b76
commit a78614a580
12 changed files with 159 additions and 27 deletions
+26
View File
@@ -1,5 +1,6 @@
local font = require("font")
local vol = require("volume")
local theme = require("theme")
-- Set up property bindings that are used across every screen.
GLOBAL_BINDINGS = {
@@ -34,6 +35,31 @@ GLOBAL_BINDINGS = {
end),
}
local lvgl = require("lvgl")
local my_theme = {
base = {
{lvgl.PART.MAIN, lvgl.Style {
bg_opa = lvgl.OPA(0),
text_font = font.fusion_12,
text_color = "#ff0000", -- Red to check it applies
}},
{lvgl.STATE.FOCUSED, lvgl.Style {
bg_opa = lvgl.OPA(100),
bg_color = "#0000ff", -- ew
text_color = "#ff0000", -- Red to check it applies
}},
},
button = {
{lvgl.STATE.FOCUSED, lvgl.Style {
bg_color = "#00ff00",
}},
{lvgl.PART.MAIN, lvgl.Style {
bg_color = "#00ff00",
}},
},
}
theme.set(my_theme)
local backstack = require("backstack")
local main_menu = require("main_menu")