Splits rendering into panels/list.lua and panels/detail.lua. List implements row hit-test, scroll-state, whole-list bg-tint hook for the dep-conflict UX (L-Q6). Detail renders an empty-state placeholder until L.4-L.7 fill in title, description, deps, carousel, and launch button.
38 lines
1.1 KiB
Lua
38 lines
1.1 KiB
Lua
local M = {}
|
|
|
|
local PADDING = 24
|
|
local COLOR_BG = 0x282828FF
|
|
local COLOR_TEXT = 0xE0E0E0FF
|
|
local COLOR_DIM = 0xA0A0A0FF
|
|
local FONT_TITLE = 28
|
|
local FONT_BODY = 14
|
|
|
|
function M.render(ctx)
|
|
local p = ctx.detail_panel_rect
|
|
engine.render.draw_rect(p.x, p.y, p.w, p.h, COLOR_BG)
|
|
|
|
if not ctx.selected_entry then
|
|
-- Empty state: background image + hint text (L.10 ships the image).
|
|
if ctx.bg_texture then
|
|
engine.render.draw_texture(ctx.bg_texture, p.x, p.y)
|
|
end
|
|
local hint = ctx.t("empty_hint")
|
|
local w, h = engine.render.measure_text(hint, FONT_BODY)
|
|
engine.render.draw_text(hint,
|
|
p.x + (p.w - w) / 2, p.y + (p.h - h) / 2,
|
|
FONT_BODY, COLOR_DIM)
|
|
return
|
|
end
|
|
|
|
-- Stub for L.4/L.5/L.6/L.7: full content lands later.
|
|
engine.render.draw_text(tostring(ctx.selected_entry),
|
|
p.x + PADDING, p.y + PADDING, FONT_TITLE, COLOR_TEXT)
|
|
end
|
|
|
|
function M.handle_click(ctx, mx, my)
|
|
-- Stub: real hit-tests for launch button + carousel arrows in L.5/L.7.
|
|
return false
|
|
end
|
|
|
|
return M
|