Skip to content

Commit

Permalink
Disable splash screen fade-out animations on WASM
Browse files Browse the repository at this point in the history
Startup time is more important on WASM, so don't play them.

Fixes #1327
  • Loading branch information
chriadam committed Jul 16, 2024
1 parent 349a7b3 commit eb19a19
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions components/SplashView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ Rectangle {
color: Theme.color_background_primary
visible: Global.splashScreenVisible

property bool allPagesLoaded: Global.allPagesLoaded
onAllPagesLoadedChanged: {
if (Qt.platform.os == "wasm") {
// skip the fade and logo animations on WebAssembly
// as startup speed is more important.
hideSplashView()
}
}

function hideSplashView() {
Global.splashScreenVisible = false
// reset the state variables we animated.
logoIcon.opacity = 1.0
logoText.opacity = 1.0
extraInfoColumn.nextOpacity = 1.0
loadingProgress.opacity = 1.0
loadingProgress.visible = true
}

OpacityAnimator on opacity {
id: fadeOutAnim

Expand All @@ -21,13 +40,7 @@ Rectangle {
duration: Theme.animation_splash_fade_duration
onRunningChanged: {
if (!running) {
Global.splashScreenVisible = false
// reset the state variables we animated.
logoIcon.opacity = 1.0
logoText.opacity = 1.0
extraInfoColumn.nextOpacity = 1.0
loadingProgress.opacity = 1.0
loadingProgress.visible = true
root.hideSplashView()
}
}
}
Expand All @@ -49,7 +62,8 @@ Rectangle {
}
}

source: Theme.colorScheme === Theme.Light
source: Qt.platform.os == "wasm" ? null
: Theme.colorScheme === Theme.Light
? Theme.screenSize === Theme.SevenInch
? "qrc:/images/gauge_intro_7_matte_white.gif"
: "qrc:/images/gauge_intro_5_matte_white.gif"
Expand Down Expand Up @@ -113,7 +127,7 @@ Rectangle {
SequentialAnimation {
id: initialFadeAnimation

running: Global.allPagesLoaded
running: Global.allPagesLoaded && Qt.platform.os != "wasm"

PropertyAction {
target: extraInfoColumn
Expand Down

0 comments on commit eb19a19

Please sign in to comment.