From 3d723de1022d2fdeccb9bae6f934e6936445ef21 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 16 Oct 2020 19:04:14 +0300 Subject: Player: Hide volume slider after 3 sec idle time --- src/ui/documentwidget.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ui/documentwidget.c') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 1a7bf4a4..85c17a5b 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -460,7 +460,12 @@ static void animatePlayingAudio_DocumentWidget_(void *widget) { if (document_App() != d) return; iConstForEach(PtrArray, i, &d->visiblePlayers) { const iGmRun *run = i.ptr; - iPlayer *plr = audioPlayer_Media(media_GmDocument(d->doc), run->audioId); + iPlayer * plr = audioPlayer_Media(media_GmDocument(d->doc), run->audioId); + if (idleTimeMs_Player(plr) > 3000 && ~flags_Player(plr) & volumeGrabbed_PlayerFlag && + flags_Player(plr) & adjustingVolume_PlayerFlag) { + setFlags_Player(plr, adjustingVolume_PlayerFlag, iFalse); + refresh_Widget(d); + } if (isStarted_Player(plr) && !isPaused_Player(plr)) { refresh_Widget(d); addTicker_App(animatePlayingAudio_DocumentWidget_, d); -- cgit v1.2.3