mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-06 02:32:44 +00:00
Polish UI elements
This commit is contained in:
parent
75474e1793
commit
f028e38b7a
7 changed files with 101 additions and 42 deletions
|
@ -33,6 +33,7 @@ SilicaItem {
|
|||
property string fallbackImage
|
||||
property bool usingFallbackImage
|
||||
property color fallbackColor: Theme.highlightColor
|
||||
property bool forceBlurhash: false // Force display the blurhash state even though the image is already loaded
|
||||
|
||||
property var __parentPage : null
|
||||
property bool _alreadyLoaded: false
|
||||
|
@ -117,7 +118,7 @@ SilicaItem {
|
|||
states: [
|
||||
State {
|
||||
name: "fallback"
|
||||
when: (blurhash.length === 0) && (realImage.status === Image.Error || realImage.status === Image.Null || realImage.status === Image.Loading)
|
||||
when: !forceBlurhash && (blurhash.length === 0) && (realImage.status === Image.Error || realImage.status === Image.Null || realImage.status === Image.Loading)
|
||||
PropertyChanges {
|
||||
target: fallbackBackground
|
||||
opacity: 1
|
||||
|
@ -125,7 +126,7 @@ SilicaItem {
|
|||
},
|
||||
State {
|
||||
name: "blurhash"
|
||||
when: blurhash.length > 0 && (realImage.status === Image.Error || realImage.status === Image.Null || realImage.status === Image.Loading)
|
||||
when: !forceBlurhash && blurhash.length > 0 && (realImage.status === Image.Error || realImage.status === Image.Null || realImage.status === Image.Loading)
|
||||
PropertyChanges {
|
||||
target: blurhashImage
|
||||
opacity: 1
|
||||
|
@ -133,11 +134,19 @@ SilicaItem {
|
|||
},
|
||||
State {
|
||||
name: "loaded"
|
||||
when: realImage.status === Image.Ready
|
||||
when: !root.forceBlurhash && realImage.status === Image.Ready
|
||||
PropertyChanges {
|
||||
target: realImage
|
||||
//opacity: 1
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "forcedBlurhash"
|
||||
when: forceBlurhash
|
||||
PropertyChanges {
|
||||
target: blurhashImage
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue