Skip to content

Commit

Permalink
Add showChapterTooltip config toggle (Issue #13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zren committed Jun 5, 2022
1 parent de3860a commit 183c790
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ A complete list of configuration keys can be found at the top of [`osc_tethys.lu
# Config
showPictureInPictureButton=yes
showSpeedButton=yes
showChapterTooltip=yes # Show chapter above timestamp in seekbar tooltip
skipBy=5 # skipback/skipfrwd amount in seconds
skipByMore=30 # RightClick skipback/skipfrwd amount in seconds
skipMode=exact # "exact" (mordenx default) or "relative+keyframes" (mpv default)
Expand Down
6 changes: 4 additions & 2 deletions osc_tethys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ local tethys = {
-- Config
showPictureInPictureButton = true,
showSpeedButton = true,
showChapterTooltip = true, -- Show chapter above timestamp in seekbar tooltip
skipBy = 5, -- skipback/skipfrwd amount in seconds
skipByMore = 30, -- RightClick skipback/skipfrwd amount in seconds
skipMode = "exact", -- "exact" (mordenx default) or "relative+keyframes" (mpv default)
Expand Down Expand Up @@ -1822,9 +1823,10 @@ function renderThumbnailTooltip(pos, sliderPos, ass)

local chapter = get_chapter(thumbTime)
local hasChapter = not (chapter == nil) and chapter.title and chapter.title ~= ""
local showChapter = hasChapter and tethys.showChapterTooltip
local chapterLabel = ""
local chapterHeight = 0
if hasChapter then
if showChapter then
chapterHeight = tethys.seekbarTimestampSize
chapterLabel = chapter.title
end
Expand Down Expand Up @@ -1876,7 +1878,7 @@ function renderThumbnailTooltip(pos, sliderPos, ass)
local timestampY = thumbY + thumbHeight + chapterHeight + math.floor(timestampHeight/2)

---- Chapter
if hasChapter then
if showChapter then
ass:new_event()
ass:pos(chapterX, chapterY)
ass:an(chapterAn)
Expand Down

0 comments on commit 183c790

Please sign in to comment.