mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 02:22:18 +02:00
Update
This commit is contained in:
@@ -3,14 +3,13 @@
|
||||
---@field container druid.container
|
||||
---@field text_name druid.text
|
||||
---@field button druid.button
|
||||
---@field text_button druid.text
|
||||
---@field druid druid_instance
|
||||
local M = {}
|
||||
|
||||
function M:init()
|
||||
self.root = self:get_node("root")
|
||||
self.text_name = self.druid:new_text("text_name")
|
||||
:set_text_adjust("scale_then_trim_left", 0.3)
|
||||
:set_text_adjust("scale_then_trim", 0.3)
|
||||
|
||||
self.selected = self:get_node("selected")
|
||||
gui.set_alpha(self.selected, 0)
|
||||
@@ -30,11 +29,23 @@ end
|
||||
|
||||
|
||||
---@param text string
|
||||
---@return property_input
|
||||
function M:set_text_button(text)
|
||||
self.text_button:set_text(text)
|
||||
---@return widget.property_input
|
||||
function M:set_text_property(text)
|
||||
self.text_name:set_text(text)
|
||||
return self
|
||||
end
|
||||
|
||||
---@param text string
|
||||
---@return widget.property_input
|
||||
function M:set_text_value(text)
|
||||
self.rich_input:set_text(text)
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
function M:on_change(callback, callback_context)
|
||||
self.rich_input.input.on_input_unselect:subscribe(callback, callback_context)
|
||||
end
|
||||
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user