mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-07 19:49:53 -05:00
got all window dragging, passthrough for mousemaps is still improper
This commit is contained in:
parent
1f45f27f74
commit
b37519369d
6 changed files with 84 additions and 39 deletions
|
|
@ -279,6 +279,7 @@ local master = function()
|
|||
mez.input.set_cursor_type("pointer")
|
||||
end,
|
||||
drag = function(pos, drag)
|
||||
print("running this too!")
|
||||
if drag.view ~= nil then
|
||||
mez.view.set_position(drag.view.id, pos.x - drag.view.offset.x, pos.y - drag.view.offset.y)
|
||||
end
|
||||
|
|
@ -288,6 +289,28 @@ local master = function()
|
|||
end,
|
||||
}, {})
|
||||
|
||||
-- This is so impractical
|
||||
-- I love it
|
||||
mez.input.add_mousemap("alt|shift", "BTN_LEFT", {
|
||||
press = function()
|
||||
mez.input.set_cursor_type("cross")
|
||||
move_all_drag = {}
|
||||
for _, id in ipairs(mez.view.get_all_ids()) do
|
||||
move_all_drag[id] = mez.view.get_position(id)
|
||||
end
|
||||
end,
|
||||
drag = function(pos, drag)
|
||||
print("Dragging")
|
||||
for id, view_start in pairs(move_all_drag) do
|
||||
mez.view.set_position(id, view_start.x + pos.x - drag.start.x, view_start.y + pos.y - drag.start.y)
|
||||
end
|
||||
end,
|
||||
release = function()
|
||||
move_all_drag = nil
|
||||
mez.input.set_cursor_type("default")
|
||||
end
|
||||
})
|
||||
|
||||
mez.input.add_mousemap("alt", "BTN_RIGHT", {
|
||||
press = function()
|
||||
mez.input.set_cursor_type("cross")
|
||||
|
|
@ -306,6 +329,7 @@ local master = function()
|
|||
mez.input.set_cursor_type("default")
|
||||
end
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
master()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue