mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Little code refactor, update changelog
This commit is contained in:
@@ -27,8 +27,8 @@ function Hover.init(self, node, on_hover_callback)
|
||||
|
||||
self._is_hovered = false
|
||||
self._is_mouse_hovered = false
|
||||
|
||||
self._is_enabled = true
|
||||
self._is_mobile = helper.is_mobile()
|
||||
|
||||
self.on_hover = Event(on_hover_callback)
|
||||
self.on_mouse_hover = Event()
|
||||
@@ -41,7 +41,7 @@ function Hover.on_input(self, action_id, action)
|
||||
end
|
||||
|
||||
-- Disable nil (it's mouse) hover or mobile platforms
|
||||
if not action_id and helper.is_mobile() then
|
||||
if self._is_mobile and not action_id then
|
||||
return false
|
||||
end
|
||||
|
||||
|
@@ -5,8 +5,6 @@ local const = require("druid.const")
|
||||
|
||||
local M = {}
|
||||
|
||||
local system_name = sys.get_sys_info().system_name
|
||||
|
||||
--- Text node or icon node can be nil
|
||||
local function get_text_width(text_node)
|
||||
if text_node then
|
||||
@@ -183,7 +181,8 @@ end
|
||||
--- Check if device is mobile (Android or iOS)
|
||||
-- @function helper..is_mobile
|
||||
function M.is_mobile()
|
||||
return const.CURRENT_SYSTEM_NAME == const.OS.IOS or const.CURRENT_SYSTEM_NAME == const.OS.ANDROID
|
||||
return const.CURRENT_SYSTEM_NAME == const.OS.IOS or
|
||||
const.CURRENT_SYSTEM_NAME == const.OS.ANDROID
|
||||
end
|
||||
|
||||
|
||||
|
@@ -65,9 +65,8 @@ M["scroll"] = {
|
||||
INERT_SPEED = 30, -- koef. of inert speed
|
||||
EXTRA_STRETCH_SIZE = 100, -- extra size in pixels outside of scroll (stretch effect)
|
||||
POINTS_DEADZONE = 20, -- Speed to check points of interests in no_inertion mode
|
||||
|
||||
SCROLL_WHEEL_SPEED = 20,
|
||||
|
||||
WHEEL_SCROLL_SPEED = 20,
|
||||
WHEEL_SCROLL_INVERTED = false,
|
||||
SMALL_CONTENT_SCROLL = true, -- If true, content node with size less than view node size can be scrolled
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user