Skip to content

Commit

Permalink
fix: can't click action buttons outside menu
Browse files Browse the repository at this point in the history
closes #971
  • Loading branch information
tomasklaen committed Sep 2, 2024
1 parent 9455db0 commit 6de09a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/uosc/elements/Menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,7 @@ function Menu:render()
local margin = self.gap * 2
local size = item_by - item_ay - margin * 2
local rect_width = size * #actions + margin * (#actions - 1)
item_can_blur_action_index = menu.action_index ~= nil

-- Place actions outside of menu when requested and there's enough space for it
actions_rect = {
Expand Down Expand Up @@ -1393,12 +1394,11 @@ function Menu:render()
})

-- Select action on cursor hover
if cursor_is_moving then
item_can_blur_action_index = menu.action_index ~= nil
if get_point_to_rectangle_proximity(cursor, rect) == 0 then
cursor:zone('primary_click', rect, self:create_action(function(shortcut)
self:activate_selected_item(shortcut)
end))
if get_point_to_rectangle_proximity(cursor, rect) == 0 then
cursor:zone('primary_click', rect, self:create_action(function(shortcut)
self:activate_selected_item(shortcut)
end))
if cursor_is_moving then
item_can_blur_action_index = false
if not is_active then
menu.action_index = action_index
Expand Down

0 comments on commit 6de09a6

Please sign in to comment.