diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/fonts/fusion10 | bin | 387500 -> 395428 bytes | |||
| -rw-r--r-- | lua/fonts/fusion12 | bin | 663688 -> 663972 bytes | |||
| -rw-r--r-- | lua/licenses.lua | 40 | ||||
| -rw-r--r-- | lua/settings.lua | 28 | ||||
| -rw-r--r-- | lua/widgets.lua | 14 |
5 files changed, 58 insertions, 24 deletions
diff --git a/lua/fonts/fusion10 b/lua/fonts/fusion10 Binary files differindex adf6fcfc..78369227 100644 --- a/lua/fonts/fusion10 +++ b/lua/fonts/fusion10 diff --git a/lua/fonts/fusion12 b/lua/fonts/fusion12 Binary files differindex c19f896c..b7bffc08 100644 --- a/lua/fonts/fusion12 +++ b/lua/fonts/fusion12 diff --git a/lua/licenses.lua b/lua/licenses.lua index 31d48a40..7a66c063 100644 --- a/lua/licenses.lua +++ b/lua/licenses.lua @@ -62,19 +62,18 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.]]) end -local function xiphbsd(copyright) +local function bsd3(copyright, name) show_license(copyright .. [[ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -- Neither the name of the Xiph.org Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +* Neither the name of ]] .. name .. [[ nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]]) +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.]]) end local function apache(copyright) @@ -203,6 +202,9 @@ return function(self) library("Fusion font", "OFL", function() ofl("Copyright (C) 2022 TakWolf") end) + library("Galmuri font", "OFL", function() + ofl("Copyright (c) 2019–2024 Lee Minseo (quiple@quiple.dev)") + end) library("komihash", "MIT", function() mit("Copyright (c) 2021-2022 Aleksey Vaneev") end) @@ -242,27 +244,35 @@ return function(self) library("MillerShuffle", "Apache 2.0", function() apache("Copyright 2022 Ronald Ross Miller") end) + library("Miseki font", "OFL", function() + ofl("Copyright (c) 2023-2024 Mark Li (itmarkibfb@gmail.com)") + end) library("ogg", "BSD", function() - xiphbsd("Copyright (c) 2002, Xiph.org Foundation") + bsd3("Copyright (c) 2002, Xiph.org Foundation", "Xiph.org Foundation") end) library("Opus", "BSD", function() - xiphbsd( - "Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo") + bsd3( + "Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo", + "Xiph.org Foundation") end) library("Opusfile", "BSD", function() - xiphbsd("Copyright (c) 1994-2013 Xiph.Org Foundation and contributors") + bsd3("Copyright (c) 1994-2013 Xiph.Org Foundation and contributors", "Xiph.org Foundation") end) library("result", "MIT", function() mit("Copyright (c) 2017-2021 Matthew Rodusek") end) library("speexdsp", "BSD", function() - xiphbsd( - "Copyright 2002-2008 Xiph.org Foundation, Copyright 2002-2008 Jean-Marc Valin, Copyright 2005-2007 Analog Devices Inc., Copyright 2005-2008 Commonwealth Scientific and Industrial Research, Organisation (CSIRO), Copyright 1993, 2002, 2006 David Rowe, Copyright 2003 EpicGames, Copyright 1992-1994 Jutta Degener, Carsten Bormann") + bsd3( + "Copyright 2002-2008 Xiph.org Foundation, Copyright 2002-2008 Jean-Marc Valin, Copyright 2005-2007 Analog Devices Inc., Copyright 2005-2008 Commonwealth Scientific and Industrial Research, Organisation (CSIRO), Copyright 1993, 2002, 2006 David Rowe, Copyright 2003 EpicGames, Copyright 1992-1994 Jutta Degener, Carsten Bormann", + "Xiph.org Foundation") end) library("tinyfsm", "MIT", function() mit("Copyright (c) 2012-2022 Axel Burri") end) library("tremor", "BSD", function() - xiphbsd("Copyright (c) 2002, Xiph.org Foundation") + bsd3("Copyright (c) 2002, Xiph.org Foundation", "Xiph.org Foundation") + end) + library("WavPack", "BSD", function() + bsd3("Copyright (c) 1998 - 2006 Conifer Software, All rights reserved.", "Conifer Software") end) end diff --git a/lua/settings.lua b/lua/settings.lua index d60ecfda..bd5be2ee 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -406,24 +406,38 @@ settings.ThemeSettings = SettingsScreen:new { selected_idx = idx end - local theme_chooser = self.content:Dropdown { + local theme_container = self.content:Object { + w = lvgl.PCT(100), + h = lvgl.SIZE_CONTENT, + flex = { + flex_direction = "column", + justify_content = "flex-start", + align_items = "space-evenly", + align_content = "flex-start", + }, + pad_row = 4, + } + theme_container:add_style(styles.list_item) + local theme_chooser = theme_container:Dropdown { options = options, symbol = img.chevron, } - local theme_chooser_desc = widgets.Description(theme_chooser, "Theme") - theme_chooser:set({ selected = selected_idx }) - - theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, function() + local theme_reload = function() local option = theme_chooser:get('selected_str') local selectedTheme = themeOptions[option] if (selectedTheme) then theme.load_theme(tostring(selectedTheme)) backstack.reset(main_menu:new()) end - end) - + end + theme_chooser:set({ selected = selected_idx }) + theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, theme_reload) theme_chooser:focus() + + local theme_reload_btn = theme_container:Button {} + theme_reload_btn:Label { text = "Reload" } + theme_reload_btn:onClicked(theme_reload) end } diff --git a/lua/widgets.lua b/lua/widgets.lua index 5e2ed858..6274cd1c 100644 --- a/lua/widgets.lua +++ b/lua/widgets.lua @@ -112,8 +112,9 @@ function widgets.StatusBar(parent, opts) } if not opts.transparent_bg then - theme.set_subject(root, "header"); + theme.set_subject(root, "header") end + theme.set_subject(root, "status_bar") if opts.back_cb then local back = root:Button { @@ -148,6 +149,7 @@ function widgets.StatusBar(parent, opts) if opts.title then title:set { text = opts.title } end + theme.set_subject(title, "status_bar_title") local db_updating = root:Image { src = img.db } theme.set_subject(db_updating, "database_indicator") @@ -160,9 +162,10 @@ function widgets.StatusBar(parent, opts) local is_charging = nil local percent = nil + local charge_state = nil local function update_battery_icon() - if is_charging == nil or percent == nil then return end + if is_charging == nil or percent == nil or charge_state == nil then return end local src theme.set_subject(battery_icon, "battery") if percent >= 95 then @@ -184,10 +187,13 @@ function widgets.StatusBar(parent, opts) theme.set_subject(battery_icon, "battery_0") src = img.bat_0 end + theme.set_subject(battery_icon, "battery_state_" .. charge_state) if is_charging then theme.set_subject(battery_icon, "battery_charging") theme.set_subject(charge_icon, "battery_charge_icon") + theme.set_subject(charge_icon, "battery_charge_icon_state_" .. charge_state) theme.set_subject(charge_icon_outline, "battery_charge_outline") + theme.set_subject(charge_icon_outline, "battery_charge_icon_outline_state_" .. charge_state) charge_icon:clear_flag(lvgl.FLAG.HIDDEN) charge_icon_outline:clear_flag(lvgl.FLAG.HIDDEN) else @@ -209,6 +215,10 @@ function widgets.StatusBar(parent, opts) percent = pct update_battery_icon() end), + power.charge_state:bind(function(state) + charge_state = state + update_battery_icon() + end), power.plugged_in:bind(function(p) is_charging = p update_battery_icon() |
