feat: menu items now accept selectable and align options

Allows creating placeholder items like "Empty" that can't be selected or clicked.
This commit is contained in:
tomasklaen
2023-05-15 11:22:53 +02:00
parent 9c544bf565
commit 128c76c3ba
5 changed files with 43 additions and 16 deletions

View File

@@ -411,7 +411,7 @@ function Timeline:render()
-- Chapter title
if #state.chapters > 0 then
local _, chapter = itable_find(state.chapters, function(c) return hovered_seconds >= c.time end, true)
local _, chapter = itable_find(state.chapters, function(c) return hovered_seconds >= c.time end, #state.chapters, 1)
if chapter and not chapter.is_end_only then
ass:tooltip(tooltip_anchor, chapter.title_wrapped, {
size = self.font_size, offset = 10, responsive = false, bold = true,