[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: remove unused alias in GridItem
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Aug 8 11:34:36 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
249a5f39 by Pierre Lamot at 2024-08-08T11:01:32+00:00
qml: remove unused alias in GridItem
- - - - -
11193da6 by Pierre Lamot at 2024-08-08T11:01:32+00:00
qml: fix MediaCover fallback image still being loaded during main cover loading
- - - - -
2 changed files:
- modules/gui/qt/widgets/qml/GridItem.qml
- modules/gui/qt/widgets/qml/MediaCover.qml
Changes:
=====================================
modules/gui/qt/widgets/qml/GridItem.qml
=====================================
@@ -51,7 +51,6 @@ T.ItemDelegate {
property alias image: picture.source
property alias cacheImage: picture.cacheImage
- property alias isImageReady: picture.isImageReady
property alias fallbackImage: picture.fallbackImageSource
property alias title: titleLabel.text
=====================================
modules/gui/qt/widgets/qml/MediaCover.qml
=====================================
@@ -41,8 +41,7 @@ Rectangle {
property alias cacheImage: image.cache
- property bool isImageReady: image.status == Widgets.RoundImage.Ready
-
+ property bool _loadTimeout: false
property string fallbackImageSource
@@ -71,11 +70,9 @@ Rectangle {
//delay placeholder showing up
Timer {
id: timer
- //changing running value will start/stop the timer,
- //the running value will change back to false when the timer
- //timeout regardless of the binding
- running: image.state === Image.Loading
+
interval: VLCStyle.duration_long
+ onTriggered: root._loadTimeout = true
}
Widgets.RoundImage {
@@ -88,6 +85,15 @@ Rectangle {
sourceSize.width: root.pictureWidth
sourceSize.height: root.pictureHeight
+ onStatusChanged: {
+ if (status === Widgets.RoundImage.Loading) {
+ root._loadTimeout = false
+ timer.start()
+ } else {
+ timer.stop()
+ }
+ }
+
cache: false
}
@@ -98,11 +104,13 @@ Rectangle {
radius: root.radius
- visible: !root.isImageReady && !timer.running
+ visible: image.source.toString() === "" //RoundImage.source is a QUrl
+ || image.status === Widgets.RoundImage.Error
+ || (image.status === Widgets.RoundImage.Loading && root._loadTimeout)
// we only keep this image till there is no main image
// try to release the resources otherwise
- source: !root.isImageReady ? root.fallbackImageSource : ""
+ source: visible ? root.fallbackImageSource : ""
sourceSize.width: root.pictureWidth
sourceSize.height: root.pictureHeight
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d2265e981fa19a9f5f1299e968348ed3ca98ee60...11193da6576d4f38b7a1bb46d129fbf57c53215e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d2265e981fa19a9f5f1299e968348ed3ca98ee60...11193da6576d4f38b7a1bb46d129fbf57c53215e
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list