summaryrefslogtreecommitdiff
path: root/lua/main.lua
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2024-03-07 12:12:32 +1100
committerailurux <ailuruxx@gmail.com>2024-03-07 12:12:32 +1100
commita78614a5806c9800956f10f993e1c70b74fbf323 (patch)
treee8d8208039a8bc7c7020e8b4e0cf18bc54875ab9 /lua/main.lua
parent490b067b765a05192118306e8796bf042ca31b94 (diff)
downloadtangara-fw-a78614a5806c9800956f10f993e1c70b74fbf323.tar.gz
WIP: Getting styles from lua
Diffstat (limited to 'lua/main.lua')
-rw-r--r--lua/main.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/lua/main.lua b/lua/main.lua
index 5cbbf0a6..5cfba47b 100644
--- a/lua/main.lua
+++ b/lua/main.lua
@@ -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")