Add tests for hover component

This commit is contained in:
Insality
2022-10-08 16:11:45 +03:00
parent a87f775ac7
commit 51dc34613b
6 changed files with 140 additions and 1 deletions

View File

@@ -99,6 +99,15 @@ function Hover.set_hover(self, state)
end
end
--- Return current hover state. True if touch action was on the node at current time
-- @tparam Hover self @{Hover}
-- @treturn bool The current hovered state
function Hover.is_hovered(self)
return self._is_hovered
end
--- Set mouse hover state
-- @tparam Hover self @{Hover}
-- @tparam bool state The mouse hover state
@@ -110,6 +119,14 @@ function Hover.set_mouse_hover(self, state)
end
--- Return current hover state. True if nil action_id (usually desktop mouse) was on the node at current time
-- @tparam Hover self @{Hover}
-- @treturn bool The current hovered state
function Hover.is_mouse_hovered(self)
return self._is_mouse_hovered
end
--- Strict hover click area. Useful for
-- no click events outside stencil node
-- @tparam Hover self @{Hover}