yazi/yazi-plugin/preset/components/preview.lua
2024-06-03 14:31:55 +08:00

26 lines
479 B
Lua

Preview = {
area = ui.Rect.default,
}
function Preview:render(area)
self.area = area
return {}
end
function Preview:click(event, up)
if up or not event.is_left then
return
end
local window = Folder:window(Folder.PREVIEW) or {}
if window[event.y] then
ya.manager_emit("reveal", { window[event.y].url })
else
ya.manager_emit("enter", {})
end
end
function Preview:scroll(event, step) ya.manager_emit("seek", { step }) end
function Preview:touch(event, step) end