Fixed predicate and minor propogation issue.
This commit is contained in:
parent
c58029df8b
commit
18959aebef
|
@ -77,14 +77,6 @@ local t = {
|
||||||
local parent = node:get_parent_node(core.root_view.root_node)
|
local parent = node:get_parent_node(core.root_view.root_node)
|
||||||
local n = (parent.a == node) and 0.1 or -0.1
|
local n = (parent.a == node) and 0.1 or -0.1
|
||||||
parent.divider = common.clamp(parent.divider + n, 0.1, 0.9)
|
parent.divider = common.clamp(parent.divider + n, 0.1, 0.9)
|
||||||
end,
|
|
||||||
|
|
||||||
["root:scroll"] = function(delta)
|
|
||||||
if core.active_view and core.active_view.scrollable then
|
|
||||||
core.active_view.scroll.to.y = core.active_view.scroll.to.y + delta * -config.mouse_wheel_scroll
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,3 +123,14 @@ command.add(function()
|
||||||
local node = core.root_view:get_active_node()
|
local node = core.root_view:get_active_node()
|
||||||
return not node:get_locked_size()
|
return not node:get_locked_size()
|
||||||
end, t)
|
end, t)
|
||||||
|
|
||||||
|
command.add(nil, {
|
||||||
|
["root:scroll"] = function(delta)
|
||||||
|
local view = (core.root_view.overlapping_node and core.root_view.overlapping_node.active_view) or core.active_view
|
||||||
|
if view and view.scrollable then
|
||||||
|
view.scroll.to.y = view.scroll.to.y + delta * -config.mouse_wheel_scroll
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
|
@ -113,8 +113,8 @@ function keymap.on_key_pressed(k, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function keymap.on_mouse_wheel(delta, ...)
|
function keymap.on_mouse_wheel(delta, ...)
|
||||||
return not keymap.on_key_pressed("wheel" .. (delta > 0 and "up" or "down"), delta, ...)
|
return not (keymap.on_key_pressed("wheel" .. (delta > 0 and "up" or "down"), delta, ...)
|
||||||
and keymap.on_key_pressed("wheel", delta, ...)
|
or keymap.on_key_pressed("wheel", delta, ...))
|
||||||
end
|
end
|
||||||
|
|
||||||
function keymap.on_mouse_pressed(button, x, y, clicks)
|
function keymap.on_mouse_pressed(button, x, y, clicks)
|
||||||
|
|
|
@ -1002,17 +1002,18 @@ function RootView:on_mouse_moved(x, y, dx, dy)
|
||||||
|
|
||||||
self.root_node:on_mouse_moved(x, y, dx, dy)
|
self.root_node:on_mouse_moved(x, y, dx, dy)
|
||||||
|
|
||||||
local node = self.root_node:get_child_overlapping_point(x, y)
|
self.overlapping_node = self.root_node:get_child_overlapping_point(x, y)
|
||||||
|
|
||||||
local div = self.root_node:get_divider_overlapping_point(x, y)
|
local div = self.root_node:get_divider_overlapping_point(x, y)
|
||||||
local tab_index = node and node:get_tab_overlapping_point(x, y)
|
local tab_index = self.overlapping_node and self.overlapping_node:get_tab_overlapping_point(x, y)
|
||||||
if node and node:get_scroll_button_index(x, y) then
|
if self.overlapping_node and self.overlapping_node:get_scroll_button_index(x, y) then
|
||||||
core.request_cursor("arrow")
|
core.request_cursor("arrow")
|
||||||
elseif div then
|
elseif div then
|
||||||
core.request_cursor(div.type == "hsplit" and "sizeh" or "sizev")
|
core.request_cursor(div.type == "hsplit" and "sizeh" or "sizev")
|
||||||
elseif tab_index then
|
elseif tab_index then
|
||||||
core.request_cursor("arrow")
|
core.request_cursor("arrow")
|
||||||
elseif node then
|
elseif self.overlapping_node then
|
||||||
core.request_cursor(node.active_view.cursor)
|
core.request_cursor(self.overlapping_node.active_view.cursor)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1020,7 +1021,7 @@ end
|
||||||
function RootView:on_mouse_wheel(...)
|
function RootView:on_mouse_wheel(...)
|
||||||
local x, y = self.mouse.x, self.mouse.y
|
local x, y = self.mouse.x, self.mouse.y
|
||||||
local node = self.root_node:get_child_overlapping_point(x, y)
|
local node = self.root_node:get_child_overlapping_point(x, y)
|
||||||
node.active_view:on_mouse_wheel(...)
|
return node.active_view:on_mouse_wheel(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue