plugin treeview: skip rootview events if not visible.
This commit is contained in:
parent
6386bac4e5
commit
48e86bb117
|
@ -186,6 +186,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
function TreeView:on_mouse_moved(px, py, ...)
|
function TreeView:on_mouse_moved(px, py, ...)
|
||||||
|
if not self.visible then return end
|
||||||
TreeView.super.on_mouse_moved(self, px, py, ...)
|
TreeView.super.on_mouse_moved(self, px, py, ...)
|
||||||
if self.dragging_scrollbar then return end
|
if self.dragging_scrollbar then return end
|
||||||
|
|
||||||
|
@ -223,6 +224,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
function TreeView:on_mouse_pressed(button, x, y, clicks)
|
function TreeView:on_mouse_pressed(button, x, y, clicks)
|
||||||
|
if not self.visible then return end
|
||||||
local caught = TreeView.super.on_mouse_pressed(self, button, x, y, clicks)
|
local caught = TreeView.super.on_mouse_pressed(self, button, x, y, clicks)
|
||||||
if caught or button ~= "left" then
|
if caught or button ~= "left" then
|
||||||
return true
|
return true
|
||||||
|
@ -263,6 +265,8 @@ function TreeView:update()
|
||||||
self:move_towards(self.size, "x", dest)
|
self:move_towards(self.size, "x", dest)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not self.visible then return end
|
||||||
|
|
||||||
local duration = system.get_time() - self.tooltip.begin
|
local duration = system.get_time() - self.tooltip.begin
|
||||||
if self.hovered_item and self.tooltip.x and duration > tooltip_delay then
|
if self.hovered_item and self.tooltip.x and duration > tooltip_delay then
|
||||||
self:move_towards(self.tooltip, "alpha", tooltip_alpha, tooltip_alpha_rate)
|
self:move_towards(self.tooltip, "alpha", tooltip_alpha, tooltip_alpha_rate)
|
||||||
|
@ -372,6 +376,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
function TreeView:draw()
|
function TreeView:draw()
|
||||||
|
if not self.visible then return end
|
||||||
self:draw_background(style.background2)
|
self:draw_background(style.background2)
|
||||||
local _y, _h = self.position.y, self.size.y
|
local _y, _h = self.position.y, self.size.y
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue