diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-08-12 03:19:03 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2024-08-12 03:19:03 +0000 |
| commit | d719f9c5017ad8006c21b6d546a5d70e846e9502 (patch) | |
| tree | 0da75c201e98d12b39c87743ee3ed242d2fc5809 /luals-stubs/theme.lua | |
| parent | 3d7b005dc98235899d1a9ae5a74bf11d916028b9 (diff) | |
| download | tangara-fw-d719f9c5017ad8006c21b6d546a5d70e846e9502.tar.gz | |
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 <cooljqln@noreply.codeberg.org>
Co-authored-by: ailurux <ailuruxx@gmail.com>
Co-committed-by: ailurux <ailuruxx@gmail.com>
Diffstat (limited to 'luals-stubs/theme.lua')
| -rw-r--r-- | luals-stubs/theme.lua | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/luals-stubs/theme.lua b/luals-stubs/theme.lua new file mode 100644 index 00000000..4a945cb3 --- /dev/null +++ b/luals-stubs/theme.lua @@ -0,0 +1,28 @@ +--- @meta + +--- @class theme +local theme = {} + +--- Loads a theme from a filename, this can be either builtin (ie, located in +--- "/lua/") or on the sdcard (in, '/sdcard/.themes/') +--- If successful, the filename will be saved to non-volatile storage. +--- Returns whether the theme was successfully loaded +--- @param filename string +--- @return boolean +function theme.load_theme(filename) end + +--- Sets a theme directly from a table. Does not persist between restarts. +--- @param theme +function theme.set(theme) end + +--- Set the style name (similar in concept to a css selector) for an object +--- This will set any styles associated with that style name on the object +--- @param obj Object The object to set a particular style on +--- @param style string The name of the style to apply to this object +function theme.set_style(obj, style) end + +--- Returns the filename of the saved theme +--- @return string +function theme.theme_filename() end + +return theme |
