Fix queue notification hint (#284)

* Fix queue notification hint

* Lint fix

* duplicate import

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
Brahim Hadricheandgithub-action linter authored and GitHub committed 2024-02-09 19:34:48 -05:00
1 parent b076517c1b
commit 11fb644fc6
4 files changed
+7 -2

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- [Attempt #2] to fix a crash caused by execution timeout when stopping a video takes too long
- Wrong hint on the "added to queue" notification when in fullscreen
## [0.19.1] - 2024-01-13
@@ -3,6 +3,7 @@
<field id="content" type="node" onChange="OnContentSet" />
<field id="thumbnail" type="uri" alias="thumbnailPoster.uri" />
<field id="line1" type="string" alias="line1Label.text" />
<field id="hintVisible" type="boolean" alias="hintLabel.visible" />
<field id="show" type="boolean" alwaysNotify="true" onChange="OnShow" />
</interface>
<children>
@@ -41,6 +42,7 @@
wrap="true" />
</LayoutGroup>
<Label
id="hintLabel"
width="480"
font="font:SmallestSystemFont"
color="0x262626ff"
@@ -1,13 +1,14 @@
namespace PlayQueue
const NOTIFICATION_NODE_ID = "PlayQueueNotification"
function ShowNotifcation(notifications as object, contentNode as object) as void
function ShowNotifcation(notifications as object, contentNode as object, hintVisible as boolean) as void
notification = notifications.findNode(NOTIFICATION_NODE_ID)
if notification = invalid
notification = notifications.createChild("PlayQueueNotification")
notification.id = NOTIFICATION_NODE_ID
end if
notification.content = contentNode
notification.hintVisible = hintVisible
notification.show = true
end function
@@ -42,7 +42,8 @@ function AddToQueue(node as object)
m.content.appendChild(node)
queueNotifications = m.top.preferences["misc.queue_notifications"]
if queueNotifications
PlayQueue.ShowNotifcation(m.top.notifications, node)
hintVisible = VideoUtils.GetVideoPlayer() = invalid or not VideoUtils.IsVideoPlayerFullScreen()
PlayQueue.ShowNotifcation(m.top.notifications, node, hintVisible)
end if
end function