Refactor text setting methods and remove ldoc files

This commit is contained in:
Insality
2024-12-08 13:35:41 +02:00
parent 9a1cd795b8
commit 6b8bbe1970
26 changed files with 158 additions and 544 deletions

View File

@@ -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

View File

@@ -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()

View File

@@ -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