mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Refactor text setting methods and remove ldoc files
This commit is contained in:
@@ -51,13 +51,13 @@ local event = require("event.event")
|
||||
---@field private _cache table
|
||||
---@field private _data table
|
||||
---@field private _data_visual table
|
||||
---@field private top_index number
|
||||
---@field top_index number
|
||||
local M = component.create("data_list")
|
||||
|
||||
|
||||
--- The DataList constructor
|
||||
---@param scroll Scroll The Scroll instance for Data List component
|
||||
---@param grid StaticGrid The StaticGrid} or @{DynamicGrid instance for Data List component
|
||||
---@param scroll druid.scroll The Scroll instance for Data List component
|
||||
---@param grid druid.grid The StaticGrid} or @{DynamicGrid instance for Data List component
|
||||
---@param create_function function The create function callback(self, data, index, data_list). Function should return (node, [component])
|
||||
function M:init(scroll, grid, create_function)
|
||||
self.scroll = scroll
|
||||
|
@@ -157,7 +157,7 @@ end
|
||||
|
||||
--- The Input constructor
|
||||
---@param click_node node Node to enabled input component
|
||||
---@param text_node node|Text Text node what will be changed on user input. You can pass text component instead of text node name Text
|
||||
---@param text_node node|druid.text Text node what will be changed on user input. You can pass text component instead of text node name Text
|
||||
---@param keyboard_type number|nil Gui keyboard type for input field
|
||||
function M:init(click_node, text_node, keyboard_type)
|
||||
self.druid = self:get_druid()
|
||||
|
@@ -10,13 +10,13 @@
|
||||
-- @alias druid.swipe
|
||||
|
||||
--- Swipe node
|
||||
---@param node node
|
||||
--@param node node
|
||||
|
||||
--- Restriction zone
|
||||
---@param click_zone node|nil
|
||||
--@param click_zone node|nil
|
||||
|
||||
--- Trigger on swipe event(self, swipe_side, dist, delta_time)
|
||||
---@param event event on_swipe
|
||||
--@param event event on_swipe
|
||||
|
||||
---
|
||||
|
||||
@@ -59,7 +59,7 @@ local function check_swipe(self, action)
|
||||
|
||||
if is_swipe then
|
||||
local is_x_swipe = math.abs(dx) >= math.abs(dy)
|
||||
local swipe_side = false
|
||||
local swipe_side = "undefined"
|
||||
|
||||
if is_x_swipe and dx > 0 then
|
||||
swipe_side = "right"
|
||||
@@ -164,6 +164,11 @@ end
|
||||
-- restrict events outside stencil node
|
||||
---@param zone node|string|nil Gui node
|
||||
function M:set_click_zone(zone)
|
||||
if not zone then
|
||||
self.click_zone = nil
|
||||
return
|
||||
end
|
||||
|
||||
self.click_zone = self:get_node(zone)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user