This commit is contained in:
Insality
2025-03-05 22:06:06 +02:00
parent d6bec60ba9
commit 46223f0bb8
11 changed files with 557 additions and 628 deletions

View File

@@ -21,16 +21,6 @@ local component = require("druid.component")
local M = component.create("swipe")
---@param style druid.swipe.style
function M:on_style_change(style)
self.style = {
SWIPE_TIME = style.SWIPE_TIME or 0.4,
SWIPE_THRESHOLD = style.SWIPE_THRESHOLD or 50,
SWIPE_TRIGGER_ON_MOVE = style.SWIPE_TRIGGER_ON_MOVE or false,
}
end
---@param node_or_node_id node|string
---@param on_swipe_callback function
function M:init(node_or_node_id, on_swipe_callback)
@@ -55,6 +45,16 @@ function M:on_late_init()
end
---@param style druid.swipe.style
function M:on_style_change(style)
self.style = {
SWIPE_TIME = style.SWIPE_TIME or 0.4,
SWIPE_THRESHOLD = style.SWIPE_THRESHOLD or 50,
SWIPE_TRIGGER_ON_MOVE = style.SWIPE_TRIGGER_ON_MOVE or false,
}
end
---@param action_id hash
---@param action action
function M:on_input(action_id, action)
@@ -154,6 +154,4 @@ function M:_check_swipe(action)
end
return M