Add long click action to the tasks-menu.lua
This commit is contained in:
17
community/settings-menu.lua
Normal file
17
community/settings-menu.lua
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
-- name = "Settings menu"
|
||||||
|
-- name_id = "settings"
|
||||||
|
-- description = "Side menu with AIO settings"
|
||||||
|
-- aio_version = "4.7.99"
|
||||||
|
-- type = "drawer"
|
||||||
|
-- author = "Evgeny Zobnin (zobnin@gmail.com)
|
||||||
|
-- version = "1.0"
|
||||||
|
|
||||||
|
function on_drawer_open()
|
||||||
|
settings = aio:settings()
|
||||||
|
labels = map(function(it) return it.label end, settings)
|
||||||
|
drawer:show_list(labels)
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_click(idx)
|
||||||
|
aio:open_settings(settings[idx].name)
|
||||||
|
end
|
||||||
@@ -94,6 +94,22 @@ function on_task_click(idx)
|
|||||||
tasks:show_editor(tasks_list[idx].id)
|
tasks:show_editor(tasks_list[idx].id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function on_long_click(idx)
|
||||||
|
if prefs.curr_tab == 1 then
|
||||||
|
on_note_long_click(idx)
|
||||||
|
else
|
||||||
|
on_task_long_click(idx)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_note_long_click(idx)
|
||||||
|
system:to_clipboard(notes_list[idx].text)
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_task_long_click(idx)
|
||||||
|
system:to_clipboard(tasks_list[idx].text)
|
||||||
|
end
|
||||||
|
|
||||||
function on_button_click(idx)
|
function on_button_click(idx)
|
||||||
if idx < 3 then
|
if idx < 3 then
|
||||||
prefs.curr_tab = idx
|
prefs.curr_tab = idx
|
||||||
|
|||||||
Reference in New Issue
Block a user