2023-12-26 14:48:33 +03:00
|
|
|
Parent = {
|
|
|
|
area = ui.Rect.default,
|
|
|
|
}
|
|
|
|
|
|
|
|
function Parent:render(area)
|
|
|
|
self.area = area
|
|
|
|
|
|
|
|
local folder = Folder:by_kind(Folder.PARENT)
|
2024-02-15 15:20:28 +03:00
|
|
|
if not folder then
|
2023-12-26 14:48:33 +03:00
|
|
|
return {}
|
|
|
|
end
|
|
|
|
|
2024-02-15 15:20:28 +03:00
|
|
|
local items, markers = {}, {}
|
|
|
|
for i, f in ipairs(folder.window) do
|
2024-02-24 19:28:12 +03:00
|
|
|
items[#items + 1] = ui.ListItem(ui.Line(File:full(f))):style(File:style(f))
|
2024-02-15 15:20:28 +03:00
|
|
|
|
2024-02-15 15:24:20 +03:00
|
|
|
-- Yanked/marked/selected files
|
2024-02-24 04:11:53 +03:00
|
|
|
local marker = File:marker(f)
|
2024-02-15 15:24:20 +03:00
|
|
|
if marker ~= 0 then
|
|
|
|
markers[#markers + 1] = { i, marker }
|
2024-02-15 15:20:28 +03:00
|
|
|
end
|
2023-12-26 14:48:33 +03:00
|
|
|
end
|
|
|
|
|
2024-02-15 15:20:28 +03:00
|
|
|
return ya.flat {
|
|
|
|
ui.List(area, items),
|
|
|
|
Folder:markers(area, markers),
|
|
|
|
}
|
2023-12-26 14:48:33 +03:00
|
|
|
end
|
2024-06-03 09:31:55 +03:00
|
|
|
|
|
|
|
function Parent:click(event, up)
|
|
|
|
if up or not event.is_left then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local window = Folder:window(Folder.PARENT) or {}
|
|
|
|
if window[event.y] then
|
|
|
|
ya.manager_emit("reveal", { window[event.y].url })
|
|
|
|
else
|
|
|
|
ya.manager_emit("leave", {})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Parent:scroll(event, step) end
|
|
|
|
|
|
|
|
function Parent:touch(event, step) end
|