diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/browser.lua | 2 | ||||
| -rw-r--r-- | lua/file_browser.lua | 2 | ||||
| -rw-r--r-- | lua/licenses.lua | 4 | ||||
| -rw-r--r-- | lua/main.lua | 2 | ||||
| -rw-r--r-- | lua/main_menu.lua | 4 | ||||
| -rw-r--r-- | lua/playing.lua | 8 | ||||
| -rw-r--r-- | lua/settings.lua | 70 | ||||
| -rw-r--r-- | lua/widgets.lua | 2 |
8 files changed, 47 insertions, 47 deletions
diff --git a/lua/browser.lua b/lua/browser.lua index 31cb9b54..406c2e49 100644 --- a/lua/browser.lua +++ b/lua/browser.lua @@ -10,7 +10,7 @@ local theme = require("theme") local screen = require("screen") return screen:new{ - createUi = function(self) + create_ui = function(self) self.root = lvgl.Object(nil, { flex = { flex_direction = "column", diff --git a/lua/file_browser.lua b/lua/file_browser.lua index 08d683e1..b9c31d62 100644 --- a/lua/file_browser.lua +++ b/lua/file_browser.lua @@ -11,7 +11,7 @@ local screen = require("screen") local filesystem = require("filesystem") return screen:new { - createUi = function(self) + create_ui = function(self) self.root = lvgl.Object(nil, { flex = { flex_direction = "column", diff --git a/lua/licenses.lua b/lua/licenses.lua index 5c8d12cf..404719e3 100644 --- a/lua/licenses.lua +++ b/lua/licenses.lua @@ -8,8 +8,8 @@ local function show_license(text) backstack.push(widgets.MenuScreen:new { show_back = true, title = "Licenses", - createUi = function(self) - widgets.MenuScreen.createUi(self) + create_ui = function(self) + widgets.MenuScreen.create_ui(self) self.root:Label { w = lvgl.PCT(100), h = lvgl.SIZE_CONTENT, diff --git a/lua/main.lua b/lua/main.lua index 9dd88c84..f79b0e87 100644 --- a/lua/main.lua +++ b/lua/main.lua @@ -65,7 +65,7 @@ local function init_ui() elseif time.ticks() - lock_time > 8000 then local queue = require("queue") if queue.size:get() > 0 then - require("playing"):pushIfNotShown() + require("playing"):push_if_not_shown() end end end), diff --git a/lua/main_menu.lua b/lua/main_menu.lua index 54f382a1..a6b46a8a 100644 --- a/lua/main_menu.lua +++ b/lua/main_menu.lua @@ -13,8 +13,8 @@ local img = require("images") local playback = require("playback") return widgets.MenuScreen:new { - createUi = function(self) - widgets.MenuScreen.createUi(self) + create_ui = function(self) + widgets.MenuScreen.create_ui(self) -- At the top, a card showing details about the current track. Hidden if -- there is no track currently playing. diff --git a/lua/playing.lua b/lua/playing.lua index ff503a6c..b3b4ec4d 100644 --- a/lua/playing.lua +++ b/lua/playing.lua @@ -20,7 +20,7 @@ local icon_enabled_class = "icon_enabled" local icon_disabled_class = "icon_disabled" return screen:new { - createUi = function(self) + create_ui = function(self) self.root = lvgl.Object(nil, { flex = { flex_direction = "column", @@ -281,9 +281,9 @@ return screen:new { end), } end, - onShown = function() is_now_playing_shown = true end, - onHidden = function() is_now_playing_shown = false end, - pushIfNotShown = function(self) + on_show = function() is_now_playing_shown = true end, + on_hide = function() is_now_playing_shown = false end, + push_if_not_shown = function(self) if not is_now_playing_shown then backstack.push(self:new()) end diff --git a/lua/settings.lua b/lua/settings.lua index 3e0817e4..31fb5945 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -15,8 +15,8 @@ local main_menu = require("main_menu") local SettingsScreen = widgets.MenuScreen:new { show_back = true, - createUi = function(self) - widgets.MenuScreen.createUi(self) + create_ui = function(self) + widgets.MenuScreen.create_ui(self) self.content = self.root:Object { flex = { flex_direction = "column", @@ -35,8 +35,8 @@ local SettingsScreen = widgets.MenuScreen:new { local BluetoothPairing = SettingsScreen:new { title = "Nearby Devices", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) local devices = self.content:List { w = lvgl.PCT(100), @@ -55,14 +55,14 @@ local BluetoothPairing = SettingsScreen:new { end) } end, - onShown = function() bluetooth.discovering:set(true) end, - onHidden = function() bluetooth.discovering:set(false) end, + on_show = function() bluetooth.discovering:set(true) end, + on_hide = function() bluetooth.discovering:set(false) end, } local BluetoothSettings = SettingsScreen:new { title = "Bluetooth", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) -- Enable/Disable switch local enable_container = self.content:Object { @@ -203,8 +203,8 @@ local BluetoothSettings = SettingsScreen:new { local HeadphonesSettings = SettingsScreen:new { title = "Headphones", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) theme.set_style(self.content:Label { text = "Maxiumum volume limit", @@ -266,8 +266,8 @@ local HeadphonesSettings = SettingsScreen:new { local DisplaySettings = SettingsScreen:new { title = "Display", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) local brightness_title = self.content:Object { flex = { @@ -303,8 +303,8 @@ local DisplaySettings = SettingsScreen:new { local ThemeSettings = SettingsScreen:new { title = "Theme", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) theme.set_style(self.content:Label { text = "Theme", @@ -361,8 +361,8 @@ local ThemeSettings = SettingsScreen:new { local InputSettings = SettingsScreen:new { title = "Input Method", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) theme.set_style(self.content:Label { text = "Control scheme", @@ -420,8 +420,8 @@ local InputSettings = SettingsScreen:new { local MassStorageSettings = SettingsScreen:new { title = "USB Storage", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) local version = require("version").samd() if tonumber(version) < 3 then @@ -478,15 +478,15 @@ local MassStorageSettings = SettingsScreen:new { end) } end, - canPop = function() + can_pop = function() return not usb.msc_enabled:get() end } local DatabaseSettings = SettingsScreen:new { title = "Database", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) local db = require("database") widgets.Row(self.content, "Schema version", db.version()) @@ -545,8 +545,8 @@ local DatabaseSettings = SettingsScreen:new { local PowerSettings = SettingsScreen:new { title = "Power", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) local power = require("power") local charge_pct = widgets.Row(self.content, "Charge").right @@ -598,8 +598,8 @@ local PowerSettings = SettingsScreen:new { local SamdConfirmation = SettingsScreen:new { title = "Are you sure?", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) self.content:Label { w = lvgl.PCT(100), text = "After selecting 'flash', copy the new UF2 file onto the USB drive that appears. The screen will be blank until the update is finished.", @@ -630,8 +630,8 @@ local SamdConfirmation = SettingsScreen:new { local FirmwareSettings = SettingsScreen:new { title = "Firmware", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) local version = require("version") widgets.Row(self.content, "ESP32", version.esp()) widgets.Row(self.content, "SAMD21", version.samd()) @@ -661,16 +661,16 @@ local FirmwareSettings = SettingsScreen:new { local LicensesScreen = SettingsScreen:new { title = "Licenses", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) require("licenses")(self) end } local FccStatementScreen = SettingsScreen:new { title = "FCC Statement", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) local text_part = function(text) self.content:Label { @@ -698,8 +698,8 @@ local FccStatementScreen = SettingsScreen:new { local RegulatoryScreen = SettingsScreen:new { title = "Regulatory", - createUi = function(self) - SettingsScreen.createUi(self) + create_ui = function(self) + SettingsScreen.create_ui(self) local version = require("version") local small_row = function(left, right) @@ -770,8 +770,8 @@ local RegulatoryScreen = SettingsScreen:new { return widgets.MenuScreen:new { show_back = true, title = "Settings", - createUi = function(self) - widgets.MenuScreen.createUi(self) + create_ui = function(self) + widgets.MenuScreen.create_ui(self) local list = self.root:List { w = lvgl.PCT(100), h = lvgl.PCT(100), diff --git a/lua/widgets.lua b/lua/widgets.lua index 29e50f29..980f0bb2 100644 --- a/lua/widgets.lua +++ b/lua/widgets.lua @@ -37,7 +37,7 @@ end widgets.MenuScreen = screen:new { show_back = false, title = "", - createUi = function(self) + create_ui = function(self) self.root = lvgl.Object(nil, { flex = { flex_direction = "column", |
