Skip to content

Commit

Permalink
Thumbnail: fix incorrectly scaled horizontal margins
Browse files Browse the repository at this point in the history
The defaults have been updated to match the margin on the time widgets.
  • Loading branch information
torque committed Feb 7, 2025
1 parent ece1201 commit d5a17bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/Thumbnail.moon
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ class Thumbnail extends BarAccent
mp.commandv(
'script-message-to', 'thumbfast', 'thumb',
hoverTime,
clamp( Mouse._rawX - @thumbfast.width / 2, leftMargin, Window._rawW - @thumbfast.width - rightMargin ),
Window._rawH - bottomMargin*Window.osdScale - @thumbfast.height
clamp(
Mouse._rawX - @thumbfast.width / 2,
leftMargin * Window.osdScale,
Window._rawW - @thumbfast.width - (rightMargin * Window.osdScale)
),
Window._rawH - @thumbfast.height - (bottomMargin * Window.osdScale)
)

@needsUpdate = true
Expand Down
4 changes: 2 additions & 2 deletions src/settings.moon
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ Sets whether or not thumbnails are displayed at all. Note: thumbnail display
requires use of the thumbfast script (See: https://github.com/po5/thumbfast).
]]

settings['thumbnail-left-margin'] = 10
settings['thumbnail-left-margin'] = 4
helpText['thumbnail-left-margin'] = [[
Controls how close to the left edge of the window the thumbnail display can
get.
]]

settings['thumbnail-right-margin'] = 10
settings['thumbnail-right-margin'] = 4
helpText['thumbnail-right-margin'] = [[
Controls how close to the right edge of the window the thumbnail display can
get.
Expand Down
4 changes: 2 additions & 2 deletions torque-progressbar.conf
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ enable-thumbnail=yes

# Controls how close to the left edge of the window the thumbnail display can
# get.
thumbnail-left-margin=10
thumbnail-left-margin=4

# Controls how close to the right edge of the window the thumbnail display can
# get.
thumbnail-right-margin=10
thumbnail-right-margin=4

# Controls how far above the expanded progress bar the thumbnail display is
# positioned.
Expand Down

0 comments on commit d5a17bc

Please sign in to comment.