From ccfbd7f83f99140e7c1b17de2e6dbd4db6ac1b6d Mon Sep 17 00:00:00 2001 From: hooke007 Date: Mon, 31 Oct 2022 15:43:12 +0000 Subject: [PATCH] feat: disable previewing while dragging the timeline --- scripts/uosc_shared/elements/Timeline.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/uosc_shared/elements/Timeline.lua b/scripts/uosc_shared/elements/Timeline.lua index 9b7811b5..85b5b216 100644 --- a/scripts/uosc_shared/elements/Timeline.lua +++ b/scripts/uosc_shared/elements/Timeline.lua @@ -99,6 +99,7 @@ function Timeline:on_prop_fullormaxed() self:update_dimensions() end function Timeline:on_display() self:update_dimensions() end function Timeline:on_mouse_leave() self:clear_thumbnail() end function Timeline:on_global_mbtn_left_up() + if thumbnail.disabled then thumbnail.disabled = false end if self.pressed then mp.set_property_native('pause', self.pressed_pause) self.pressed = false @@ -114,6 +115,8 @@ Timeline.seek_timer = mp.add_timeout(0.05, function() Elements.timeline:set_from Timeline.seek_timer:kill() function Timeline:on_global_mouse_move() if self.pressed then + thumbnail.disabled = true + self:clear_thumbnail() if self.width / state.duration < 10 then self:set_from_cursor(true) self.seek_timer:kill()