From 98afb5708e2bf78ed61e2efec20872ab1fb96dbf Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 31 Oct 2024 10:05:43 +0700 Subject: [PATCH] Add aio:add_todo() method --- README.md | 7 ++++++- samples/add_todo_sample.lua | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 samples/add_todo_sample.lua diff --git a/README.md b/README.md index 097d021..cd758e5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ The type of script is determined by the line (meta tag) at the beginning of the # Changelog +### 5.5.0 + +* Added `aio:add_todo()` method + ### 5.3.5 * Added `ai` module @@ -351,7 +355,8 @@ Intent table format (all fields are optional): * `aio:do_action(string)` - performs an AIO action ([more](https://aiolauncher.app/api.html)); * `aio:actions()` - returns a list of available actions; * `aio:settings()` - returns a list of available AIO Settings sections; -* `aio:open_settings([section])` - open AIO Settings or AIO Settings section. +* `aio:open_settings([section])` - open AIO Settings or AIO Settings section; +* `aio:add_todo(icon, text)` - add a TODO item with the specified Fontawesome icon and text. Format of table elements returned by `aio:available_widgets()`: diff --git a/samples/add_todo_sample.lua b/samples/add_todo_sample.lua new file mode 100644 index 0000000..8403781 --- /dev/null +++ b/samples/add_todo_sample.lua @@ -0,0 +1,17 @@ +function on_resume() + ui:show_lines{ + "Add todo #1", + "Add todo #2", + "Add todo #3", + } +end + +function on_click(idx) + if idx == 1 then + aio:add_todo("face-smile", "Todo #1") + elseif idx == 2 then + aio:add_todo("face-smile-tongue", "Todo #2") + else + aio:add_todo("face-smile-tear", "Todo #3") + end +end