Solve #239 Remove button style

This commit is contained in:
Insality 2024-10-16 20:58:55 +03:00
parent aa6310db91
commit c0c1870ac5
4 changed files with 18 additions and 15 deletions

View File

@ -777,7 +777,6 @@ function druid__input.unselect(self) end
---@field IS_LONGTAP_ERASE boolean Is long tap will erase current input data. Default: false ---@field IS_LONGTAP_ERASE boolean Is long tap will erase current input data. Default: false
---@field IS_UNSELECT_ON_RESELECT boolean If true, call unselect on select selected input. Default: false ---@field IS_UNSELECT_ON_RESELECT boolean If true, call unselect on select selected input. Default: false
---@field MASK_DEFAULT_CHAR string Default character mask for password input. Default: *] ---@field MASK_DEFAULT_CHAR string Default character mask for password input. Default: *]
---@field button_style table Custom button style for input node
---@field on_input_wrong function (self, button_node) Callback on wrong user input ---@field on_input_wrong function (self, button_node) Callback on wrong user input
---@field on_select function (self, button_node) Callback on input field selecting ---@field on_select function (self, button_node) Callback on input field selecting
---@field on_unselect function (self, button_node) Callback on input field unselecting ---@field on_unselect function (self, button_node) Callback on input field unselecting

View File

@ -17,6 +17,24 @@
--- On input field text change to empty string callback(self, input_text) --- On input field text change to empty string callback(self, input_text)
-- @tfield node cursor -- @tfield node cursor
--- On input field text change to empty string callback(self, input_text)
-- @tfield node cursor_text
--- On input field text change to empty string callback(self, input_text)
-- @tfield vector3 cursor_position
--- On input field text change to empty string callback(self, input_text)
-- @tfield druid.text input_text
--- On input field text change to empty string callback(self, input_text)
-- @tfield druid.drag drag
--- On input field text change to empty string callback(self, input_text)
-- @tfield druid.text placeholder
--- On input field text change to empty string callback(self, input_text)
-- @tfield vector3 text_position
--- On input field text change to max length string callback(self, input_text) --- On input field text change to max length string callback(self, input_text)
-- @tfield druid.text placeholder @{Text} -- @tfield druid.text placeholder @{Text}

View File

@ -132,7 +132,6 @@ end
-- @tfield function on_select (self, button_node) Callback on input field selecting -- @tfield function on_select (self, button_node) Callback on input field selecting
-- @tfield function on_unselect (self, button_node) Callback on input field unselecting -- @tfield function on_unselect (self, button_node) Callback on input field unselecting
-- @tfield function on_input_wrong (self, button_node) Callback on wrong user input -- @tfield function on_input_wrong (self, button_node) Callback on wrong user input
-- @tfield table button_style Custom button style for input node
function Input.on_style_change(self, style) function Input.on_style_change(self, style)
self.style = {} self.style = {}
@ -143,12 +142,6 @@ function Input.on_style_change(self, style)
self.style.on_select = style.on_select or function(_, button_node) end self.style.on_select = style.on_select or function(_, button_node) end
self.style.on_unselect = style.on_unselect or function(_, button_node) end self.style.on_unselect = style.on_unselect or function(_, button_node) end
self.style.on_input_wrong = style.on_input_wrong or function(_, button_node) end self.style.on_input_wrong = style.on_input_wrong or function(_, button_node) end
self.style.button_style = style.button_style or {
LONGTAP_TIME = 0.4,
AUTOHOLD_TRIGGER = 0.8,
DOUBLETAP_TIME = 0.4
}
end end
@ -186,7 +179,6 @@ function Input.init(self, click_node, text_node, keyboard_type)
self.keyboard_type = keyboard_type or gui.KEYBOARD_TYPE_DEFAULT self.keyboard_type = keyboard_type or gui.KEYBOARD_TYPE_DEFAULT
self.button = self.druid:new_button(click_node, self.select) self.button = self.druid:new_button(click_node, self.select)
self.button:set_style(self.button_style)
self.button.on_click_outside:subscribe(self.unselect) self.button.on_click_outside:subscribe(self.unselect)
self.button.on_long_click:subscribe(clear_and_select) self.button.on_long_click:subscribe(clear_and_select)

View File

@ -141,12 +141,6 @@ M["input"] = {
end) end)
end) end)
end, end,
button = {
LONGTAP_TIME = 0.4,
AUTOHOLD_TRIGGER = 0.8,
DOUBLETAP_TIME = 0.4,
}
} }