Skip to content

Commit

Permalink
Solve #239 Remove button style
Browse files Browse the repository at this point in the history
  • Loading branch information
Insality committed Oct 16, 2024
1 parent aa6310d commit c0c1870
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
1 change: 0 additions & 1 deletion druid/annotations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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_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 button_style table Custom button style for input node
---@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_unselect function (self, button_node) Callback on input field unselecting
Expand Down
18 changes: 18 additions & 0 deletions druid/custom/rich_input/rich_input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@
--- On input field text change to empty string callback(self, input_text)
-- @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)
-- @tfield druid.text placeholder @{Text}

Expand Down
8 changes: 0 additions & 8 deletions druid/extended/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ end
-- @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_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)
self.style = {}

Expand All @@ -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_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.button_style = style.button_style or {
LONGTAP_TIME = 0.4,
AUTOHOLD_TRIGGER = 0.8,
DOUBLETAP_TIME = 0.4
}
end


Expand Down Expand Up @@ -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.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_long_click:subscribe(clear_and_select)

Expand Down
6 changes: 0 additions & 6 deletions druid/styles/default/style.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ M["input"] = {
end)
end)
end,

button = {
LONGTAP_TIME = 0.4,
AUTOHOLD_TRIGGER = 0.8,
DOUBLETAP_TIME = 0.4,
}
}


Expand Down

0 comments on commit c0c1870

Please sign in to comment.