mirror of
https://github.com/Insality/druid
synced 2025-06-28 19:07:45 +02:00
Rename input.selected to input.is_selected (according to the docs)
This commit is contained in:
parent
5d9951e03f
commit
f7b8593465
@ -131,3 +131,10 @@ Also check _component.template.lua_ what you can use for your own custom compone
|
||||
- Add `component.template.lua` as template for Druid custom component
|
||||
- Update the example app
|
||||
|
||||
|
||||
### Druid 0.6.0:
|
||||
|
||||
Desc
|
||||
|
||||
- Input component: rename field _selected_ to _is_selected_ (according to the docs)
|
||||
- Add EmmyLua annotations. See how to use it FAQ
|
||||
|
@ -71,11 +71,11 @@ end
|
||||
local function select(self)
|
||||
gui.reset_keyboard()
|
||||
self.marked_value = ""
|
||||
if not self.selected then
|
||||
if not self.is_selected then
|
||||
self:increase_input_priority()
|
||||
self.button:increase_input_priority()
|
||||
self.previous_value = self.value
|
||||
self.selected = true
|
||||
self.is_selected = true
|
||||
|
||||
gui.show_keyboard(self.keyboard_type, false)
|
||||
self.on_input_select:trigger(self:get_context())
|
||||
@ -88,10 +88,10 @@ end
|
||||
local function unselect(self)
|
||||
gui.reset_keyboard()
|
||||
self.marked_value = ""
|
||||
if self.selected then
|
||||
if self.is_selected then
|
||||
self:reset_input_priority()
|
||||
self.button:reset_input_priority()
|
||||
self.selected = false
|
||||
self.is_selected = false
|
||||
|
||||
gui.hide_keyboard()
|
||||
self.on_input_unselect:trigger(self:get_context())
|
||||
@ -145,7 +145,7 @@ function Input.init(self, click_node, text_node, keyboard_type)
|
||||
self.druid = self:get_druid(self)
|
||||
self.text = self.druid:new_text(text_node)
|
||||
|
||||
self.selected = false
|
||||
self.is_selected = false
|
||||
self.value = self.text.last_value
|
||||
self.previous_value = self.text.last_value
|
||||
self.current_value = self.text.last_value
|
||||
@ -176,7 +176,7 @@ end
|
||||
|
||||
|
||||
function Input.on_input(self, action_id, action)
|
||||
if self.selected then
|
||||
if self.is_selected then
|
||||
local input_text = nil
|
||||
if action_id == const.ACTION_TEXT then
|
||||
-- ignore return key
|
||||
@ -235,7 +235,7 @@ function Input.on_input(self, action_id, action)
|
||||
end
|
||||
end
|
||||
|
||||
return self.selected
|
||||
return self.is_selected
|
||||
end
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user