mirror of
https://github.com/Insality/druid
synced 2025-06-27 18:37:45 +02:00
#149 Call button style functions after actual callback
This commit is contained in:
parent
009c3999c4
commit
dbb883b1b8
13
druid/base/button.lua
Normal file → Executable file
13
druid/base/button.lua
Normal file → Executable file
@ -88,10 +88,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
local function on_button_click(self)
|
local function on_button_click(self)
|
||||||
self.style.on_click(self, self.anim_node)
|
|
||||||
|
|
||||||
self.click_in_row = 1
|
self.click_in_row = 1
|
||||||
self.on_click:trigger(self:get_context(), self.params, self)
|
self.on_click:trigger(self:get_context(), self.params, self)
|
||||||
|
self.style.on_click(self, self.anim_node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -101,28 +100,24 @@ local function on_button_repeated_click(self)
|
|||||||
self.is_repeated_started = true
|
self.is_repeated_started = true
|
||||||
end
|
end
|
||||||
|
|
||||||
self.style.on_click(self, self.anim_node)
|
|
||||||
|
|
||||||
self.click_in_row = self.click_in_row + 1
|
self.click_in_row = self.click_in_row + 1
|
||||||
|
|
||||||
self.on_repeated_click:trigger(self:get_context(), self.params, self, self.click_in_row)
|
self.on_repeated_click:trigger(self:get_context(), self.params, self, self.click_in_row)
|
||||||
|
self.style.on_click(self, self.anim_node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function on_button_long_click(self)
|
local function on_button_long_click(self)
|
||||||
self.style.on_click(self, self.anim_node)
|
|
||||||
|
|
||||||
self.click_in_row = 1
|
self.click_in_row = 1
|
||||||
local time = socket.gettime() - self.last_pressed_time
|
local time = socket.gettime() - self.last_pressed_time
|
||||||
self.on_long_click:trigger(self:get_context(), self.params, self, time)
|
self.on_long_click:trigger(self:get_context(), self.params, self, time)
|
||||||
|
self.style.on_click(self, self.anim_node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function on_button_double_click(self)
|
local function on_button_double_click(self)
|
||||||
self.style.on_click(self, self.anim_node)
|
|
||||||
|
|
||||||
self.click_in_row = self.click_in_row + 1
|
self.click_in_row = self.click_in_row + 1
|
||||||
self.on_double_click:trigger(self:get_context(), self.params, self, self.click_in_row)
|
self.on_double_click:trigger(self:get_context(), self.params, self, self.click_in_row)
|
||||||
|
self.style.on_click(self, self.anim_node)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user