From 48e86bb11754f6a8e67ce855092a83aef0b9a644 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Mon, 7 Mar 2022 16:52:32 -0400 Subject: [PATCH] plugin treeview: skip rootview events if not visible. --- data/plugins/treeview.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/plugins/treeview.lua b/data/plugins/treeview.lua index 6841586d..e12782b6 100644 --- a/data/plugins/treeview.lua +++ b/data/plugins/treeview.lua @@ -186,6 +186,7 @@ end function TreeView:on_mouse_moved(px, py, ...) + if not self.visible then return end TreeView.super.on_mouse_moved(self, px, py, ...) if self.dragging_scrollbar then return end @@ -223,6 +224,7 @@ end 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) if caught or button ~= "left" then return true @@ -263,6 +265,8 @@ function TreeView:update() self:move_towards(self.size, "x", dest) end + if not self.visible then return end + local duration = system.get_time() - self.tooltip.begin if self.hovered_item and self.tooltip.x and duration > tooltip_delay then self:move_towards(self.tooltip, "alpha", tooltip_alpha, tooltip_alpha_rate) @@ -372,6 +376,7 @@ end function TreeView:draw() + if not self.visible then return end self:draw_background(style.background2) local _y, _h = self.position.y, self.size.y