Apply shell theme if background reveal stalls
This commit is contained in:
@@ -66,10 +66,12 @@ Item {
|
|||||||
pendingColorsRaw = Util.decodeBase64(colorsB64)
|
pendingColorsRaw = Util.decodeBase64(colorsB64)
|
||||||
pendingShellRaw = Util.decodeBase64(shellB64)
|
pendingShellRaw = Util.decodeBase64(shellB64)
|
||||||
pendingThemeVersion = backgroundVersion
|
pendingThemeVersion = backgroundVersion
|
||||||
|
pendingThemeFallbackTimer.restart()
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyPendingTheme() {
|
function applyPendingTheme() {
|
||||||
if (pendingThemeVersion !== backgroundVersion) return
|
if (pendingThemeVersion !== backgroundVersion) return
|
||||||
|
pendingThemeFallbackTimer.stop()
|
||||||
Color.loadColors(pendingColorsRaw)
|
Color.loadColors(pendingColorsRaw)
|
||||||
// Color.loadShell also refreshes Style so the type scale flips with the
|
// Color.loadShell also refreshes Style so the type scale flips with the
|
||||||
// background reveal instead of waiting for a separate reload path.
|
// background reveal instead of waiting for a separate reload path.
|
||||||
@@ -154,6 +156,13 @@ Item {
|
|||||||
onTriggered: root.refreshBackground()
|
onTriggered: root.refreshBackground()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: pendingThemeFallbackTimer
|
||||||
|
interval: 300
|
||||||
|
repeat: false
|
||||||
|
onTriggered: root.applyPendingTheme()
|
||||||
|
}
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id: revealAnimation
|
id: revealAnimation
|
||||||
target: root
|
target: root
|
||||||
|
|||||||
@@ -10,4 +10,11 @@ assert(
|
|||||||
/theme=\$\(omarchy-theme-switcher\); \[\[ -n \$theme \]\] && omarchy-theme-set \\"\$theme\\" >\/dev\/null 2>&1 &/.test(backgroundQml),
|
/theme=\$\(omarchy-theme-switcher\); \[\[ -n \$theme \]\] && omarchy-theme-set \\"\$theme\\" >\/dev\/null 2>&1 &/.test(backgroundQml),
|
||||||
'background theme switcher starts theme application asynchronously after selection'
|
'background theme switcher starts theme application asynchronously after selection'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
assert(
|
||||||
|
backgroundQml.includes('pendingThemeFallbackTimer.restart()') &&
|
||||||
|
backgroundQml.includes('pendingThemeFallbackTimer.stop()') &&
|
||||||
|
backgroundQml.includes('id: pendingThemeFallbackTimer'),
|
||||||
|
'background theme transition applies pending colors even if image reveal stalls'
|
||||||
|
)
|
||||||
JS
|
JS
|
||||||
|
|||||||
Reference in New Issue
Block a user