refactor(gui): rækker kan klones ind i et andet layout (redigeringsvindue)

This commit is contained in:
2026-09-29 17:40:35 +02:00
parent 345e7303c1
commit 0cfb983506
2 changed files with 33 additions and 6 deletions
@@ -80,8 +80,11 @@ function SmartPickupFrame:makeRowClickable(row, action)
row.mouseEvent = function(element, posX, posY, isDown, isUp, button, eventUsed)
local used = baseMouseEvent(element, posX, posY, isDown, isUp, button, eventUsed)
-- også inden for listens synlige udsnit: rækker scrollet ud af syne må ikke fange klik
if not used and not eventUsed and isUp and button == MOUSE_LEFT and (element.getIsVisible == nil or element:getIsVisible())
and isInside(element, posX, posY) and isInside(frame.boxLayout, posX, posY) then
-- klik tæller inde i rækkens eget layout (listen eller redigeringsvinduet); listen er død mens vinduet er åbent
local layout = element.spuLayout or frame.boxLayout
local blockedByPanel = frame.editPanelOpen and layout == frame.boxLayout
if not used and not eventUsed and not blockedByPanel and isUp and button == MOUSE_LEFT and (element.getIsVisible == nil or element:getIsVisible())
and isInside(element, posX, posY) and isInside(layout, posX, posY) then
frame.pendingClick = action
return true
end