Hide hovered `TreeView` item when dragging the scrollbar

This commit is contained in:
Guldoman 2022-03-20 04:46:57 +01:00
parent 699655bebf
commit 46f9be2960
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 5 additions and 2 deletions

View File

@ -209,10 +209,13 @@ 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
self.cursor_pos.x = px
self.cursor_pos.y = py
if self.dragging_scrollbar then
self.hovered_item = nil
return
end
local item_changed, tooltip_changed
for item, x,y,w,h in self:each_item() do
if px > x and py > y and px <= x + w and py <= y + h then