From d719f9c5017ad8006c21b6d546a5d70e846e9502 Mon Sep 17 00:00:00 2001 From: ailurux Date: Mon, 12 Aug 2024 03:19:03 +0000 Subject: daniel/theme-setting (#87) - Themes can be loaded from disk and built-in - Themes can be selected in a new themes menu of the settings screen - Some touch-ups to existing themes - The saved theme is persisted in nvs Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/87 Reviewed-by: cooljqln Co-authored-by: ailurux Co-committed-by: ailurux --- lua/theme_dark.lua | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'lua/theme_dark.lua') diff --git a/lua/theme_dark.lua b/lua/theme_dark.lua index 6508f642..b9bcece2 100644 --- a/lua/theme_dark.lua +++ b/lua/theme_dark.lua @@ -95,24 +95,27 @@ local theme_dark = { switch = { {lvgl.PART.MAIN, lvgl.Style { bg_opa = lvgl.OPA(100), - width = 28, - height = 8, + width = 18, + height = 10, radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff bg_color = background_muted, - border_color = highlight_color, + border_color = text_color, + border_width = 1, }}, {lvgl.PART.INDICATOR, lvgl.Style { radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff - bg_color = background_muted, + bg_color = background_color, }}, {lvgl.PART.INDICATOR | lvgl.STATE.CHECKED, lvgl.Style { bg_color = highlight_color, + bg_opa = lvgl.OPA(100), }}, {lvgl.PART.KNOB, lvgl.Style { radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff - pad_all = 2, bg_opa = lvgl.OPA(100), bg_color = background_muted, + border_color = text_color, + border_width = 1, }}, {lvgl.PART.KNOB | lvgl.STATE.FOCUSED, lvgl.Style { bg_color = highlight_color, @@ -170,7 +173,21 @@ local theme_dark = { image_recolor = icon_enabled_color, }}, }, - + now_playing = { + {lvgl.PART.MAIN, lvgl.Style { + bg_opa = lvgl.OPA(100), + radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff + border_width = 1, + border_color = highlight_color, + border_side = 15, -- LV_BORDER_SIDE_FULL + }}, + }, + menu_icon = { + {lvgl.PART.MAIN, lvgl.Style { + pad_all = 4, + radius = 4 + }}, + }, } return theme_dark -- cgit v1.2.3 From 0662bb037b94ffc50ee7ce313c348cbe6b7f6e4c Mon Sep 17 00:00:00 2001 From: ailurux Date: Thu, 15 Aug 2024 16:14:18 +1000 Subject: Some UI/themes tweaks --- lua/theme_dark.lua | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'lua/theme_dark.lua') diff --git a/lua/theme_dark.lua b/lua/theme_dark.lua index b9bcece2..20d64495 100644 --- a/lua/theme_dark.lua +++ b/lua/theme_dark.lua @@ -79,8 +79,6 @@ local theme_dark = { radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff pad_all = 2, bg_color = background_muted, - shadow_width = 5, - shadow_opa = lvgl.OPA(100) }}, {lvgl.PART.MAIN | lvgl.STATE.FOCUSED, lvgl.Style { bg_color = background_muted, @@ -92,6 +90,31 @@ local theme_dark = { bg_color = highlight_color, }}, }, + scrubber = { + {lvgl.PART.MAIN, lvgl.Style { + bg_opa = lvgl.OPA(100), + bg_color = background_muted, + radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff + }}, + {lvgl.PART.INDICATOR, lvgl.Style { + radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff + bg_color = highlight_color, + }}, + {lvgl.PART.KNOB, lvgl.Style { + radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff + bg_color = background_muted, + }}, + {lvgl.PART.MAIN | lvgl.STATE.FOCUSED, lvgl.Style { + bg_color = background_muted, + }}, + {lvgl.PART.KNOB | lvgl.STATE.FOCUSED, lvgl.Style { + bg_color = highlight_color, + pad_all = 1, + }}, + {lvgl.PART.INDICATOR | lvgl.STATE.CHECKED, lvgl.Style { + bg_color = highlight_color, + }}, + }, switch = { {lvgl.PART.MAIN, lvgl.Style { bg_opa = lvgl.OPA(100), @@ -107,8 +130,8 @@ local theme_dark = { bg_color = background_color, }}, {lvgl.PART.INDICATOR | lvgl.STATE.CHECKED, lvgl.Style { - bg_color = highlight_color, bg_opa = lvgl.OPA(100), + bg_color = highlight_color, }}, {lvgl.PART.KNOB, lvgl.Style { radius = 32767, -- LV_RADIUS_CIRCLE = 0x7fff -- cgit v1.2.3 From 0f9005626d2d919e6995809453b9b5ec3c72096b Mon Sep 17 00:00:00 2001 From: ailurux Date: Fri, 16 Aug 2024 16:56:58 +1000 Subject: Redesigned many icons, added styles for battery icon recolouring based on percentage --- lua/theme_dark.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'lua/theme_dark.lua') diff --git a/lua/theme_dark.lua b/lua/theme_dark.lua index 20d64495..a908245f 100644 --- a/lua/theme_dark.lua +++ b/lua/theme_dark.lua @@ -211,6 +211,29 @@ local theme_dark = { radius = 4 }}, }, + battery = { + {lvgl.PART.MAIN, lvgl.Style { + image_recolor_opa = 0, + }}, + }, + battery_0 = { + {lvgl.PART.MAIN, lvgl.Style { + image_recolor_opa = 180, + image_recolor = "#aa3333", + }}, + }, + battery_charging = { + {lvgl.PART.MAIN, lvgl.Style { + image_recolor_opa = 180, + image_recolor = "#33aa33", + }}, + }, + battery_charge_icon = { + {lvgl.PART.MAIN, lvgl.Style { + image_recolor_opa = 180, + image_recolor = "#fdd833", + }}, + }, } return theme_dark -- cgit v1.2.3 From e0b057b3fa6ee1e8e8fd90d1abd6f201f73937ab Mon Sep 17 00:00:00 2001 From: ailurux Date: Tue, 27 Aug 2024 16:30:40 +1000 Subject: Various UI tweaks and improvements --- lua/theme_dark.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lua/theme_dark.lua') diff --git a/lua/theme_dark.lua b/lua/theme_dark.lua index a908245f..41fddf81 100644 --- a/lua/theme_dark.lua +++ b/lua/theme_dark.lua @@ -86,6 +86,9 @@ local theme_dark = { {lvgl.PART.KNOB | lvgl.STATE.FOCUSED, lvgl.Style { bg_color = highlight_color, }}, + {lvgl.PART.KNOB | lvgl.STATE.EDITED, lvgl.Style { + pad_all = 2, + }}, {lvgl.PART.INDICATOR | lvgl.STATE.CHECKED, lvgl.Style { bg_color = highlight_color, }}, @@ -111,6 +114,9 @@ local theme_dark = { bg_color = highlight_color, pad_all = 1, }}, + {lvgl.PART.KNOB | lvgl.STATE.EDITED, lvgl.Style { + pad_all = 2, + }}, {lvgl.PART.INDICATOR | lvgl.STATE.CHECKED, lvgl.Style { bg_color = highlight_color, }}, -- cgit v1.2.3