diff --git a/CHANGELOG.md b/CHANGELOG.md index f3ea1dd1..c8bf3372 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing worth mentioning yet. +## Fixed + +- Issue with focus in the video queue view ## [0.25.0] - 2024-07-22 diff --git a/playlet-lib/src/components/VideoQueue/VideoQueueView.bs b/playlet-lib/src/components/VideoQueue/VideoQueueView.bs index aebe4a3c..c498be33 100644 --- a/playlet-lib/src/components/VideoQueue/VideoQueueView.bs +++ b/playlet-lib/src/components/VideoQueue/VideoQueueView.bs @@ -49,12 +49,14 @@ function OnContentSet() as void end if index = content.index + videoCount = content.getChildCount() if IsInt(index) and index <> -1 - m.queueLabel.text = Tr(Locale.VideoQueue.Queue) + ` (${index + 1}/${content.getChildCount()})` + m.queueLabel.text = Tr(Locale.VideoQueue.Queue) + ` (${index + 1}/${videoCount})` else - m.queueLabel.text = Tr(Locale.VideoQueue.Queue) + ` (${content.getChildCount()})` + m.queueLabel.text = Tr(Locale.VideoQueue.Queue) + ` (${videoCount})` end if + AdjustFocus(videoCount) LoadVideoDetailsIfNeeded() end function @@ -146,6 +148,14 @@ function LoadVideoDetailsIfNeeded() as void }) end function +function AdjustFocus(videoCount as integer) + hasVideos = videoCount > 0 + if not hasVideos and m.queueList.hasFocus() + NodeSetFocus(m.clearButton, true) + end if + m.queueList.focusable = hasVideos +end function + function OnDispose() m.queueList.content = invalid DisposeObservers()