Show hand cursor on clickable elements as suggested by @Guldoman

This commit is contained in:
jgmdev 2022-02-23 05:56:59 -04:00
parent 90983b22a4
commit 3452d499e5
1 changed files with 7 additions and 1 deletions

View File

@ -733,7 +733,9 @@ function StatusView:on_mouse_moved(x, y, dx, dy)
StatusView.super.on_mouse_moved(self, x, y, dx, dy) StatusView.super.on_mouse_moved(self, x, y, dx, dy)
if y < self.position.y or system.get_time() <= self.message_timeout then if y < self.position.y or system.get_time() <= self.message_timeout then
self.hovered_item = {} return self.cursor = "arrow"
self.hovered_item = {}
return
end end
for _, item in ipairs(self.items) do for _, item in ipairs(self.items) do
@ -749,10 +751,14 @@ function StatusView:on_mouse_moved(x, y, dx, dy)
if self.hovered_item ~= item then if self.hovered_item ~= item then
self.hovered_item = item self.hovered_item = item
end end
if item.command or item.on_click then
self.cursor = "hand"
end
return return
end end
end end
end end
self.cursor = "arrow"
self.hovered_item = {} self.hovered_item = {}
end end