From 162c5febda0163fd102069a620d8dba4e562b4b5 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Mon, 10 Nov 2025 17:32:03 +0800 Subject: [PATCH 1/5] Background: add startup wallpaper transition --- Assets/settings-default.json | 1 + Commons/Settings.qml | 1 + Modules/Background/Background.qml | 59 ++++++++++++++++++- Modules/Panels/Settings/Tabs/WallpaperTab.qml | 9 +++ 4 files changed, 68 insertions(+), 2 deletions(-) diff --git a/Assets/settings-default.json b/Assets/settings-default.json index add3d975..88e7c4fd 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -120,6 +120,7 @@ "randomIntervalSec": 300, "transitionDuration": 1500, "transitionType": "random", + "startupTransitionType": "disc", "transitionEdgeSmoothness": 0.05, "monitors": [], "panelPosition": "follow_bar" diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 3d7be7f1..861be375 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -258,6 +258,7 @@ Singleton { property int randomIntervalSec: 300 // 5 min property int transitionDuration: 1500 // 1500 ms property string transitionType: "random" + property string startupTransitionType: "disc" property real transitionEdgeSmoothness: 0.05 property list monitors: [] property string panelPosition: "follow_bar" diff --git a/Modules/Background/Background.qml b/Modules/Background/Background.qml index abea1806..40fd81ea 100644 --- a/Modules/Background/Background.qml +++ b/Modules/Background/Background.qml @@ -21,6 +21,7 @@ Variants { // Internal state management property string transitionType: "fade" property real transitionProgress: 0 + property bool isStartupTransition: true readonly property real edgeSmoothness: Settings.data.wallpaper.transitionEdgeSmoothness readonly property var allTransitions: WallpaperService.allTransitions @@ -77,7 +78,11 @@ Variants { Connections { target: CompositorService function onDisplayScalesChanged() { - setWallpaperInitial() + // Recalculate image sizes without interrupting startup transition + if (isStartupTransition) { + return + } + recalculateImageSizes() } } @@ -360,7 +365,10 @@ Variants { return } - setWallpaperImmediate(WallpaperService.getWallpaper(modelData.name)) + const wallpaperPath = WallpaperService.getWallpaper(modelData.name) + + futureWallpaper = wallpaperPath + performStartupTransition() } // ------------------------------------------------------ @@ -453,6 +461,53 @@ Variants { break } } + + // ------------------------------------------------------ + // Dedicated function for startup animation + function performStartupTransition() { + // Get the transitionType from the settings + var transitionSettingType = Settings.data.wallpaper.startupTransitionType + + if (transitionSettingType == "random") { + var idx = Math.floor(Math.random() * allTransitions.length) + transitionSettingType = allTransitions[idx] + } + + // Ensure the transition type really exists + if (transitionSettingType !== "none" && !allTransitions.includes(transitionSettingType)) { + transitionSettingType = "fade" + } + + // Apply transitionType so the shader loader picks the correct shader + this.transitionType = transitionSettingType + + // Perform the chosen transition; for startup prefer centered disc when disc selected + switch (transitionSettingType) { + case "none": + setWallpaperImmediate(futureWallpaper) + break + case "wipe": + wipeDirection = Math.random() * 4 + setWallpaperWithTransition(futureWallpaper) + break + case "disc": + // Force center origin for elegant startup animation + discCenterX = 0.5 + discCenterY = 0.5 + setWallpaperWithTransition(futureWallpaper) + break + case "stripes": + stripesCount = Math.round(Math.random() * 20 + 4) + stripesAngle = Math.random() * 360 + setWallpaperWithTransition(futureWallpaper) + break + default: + setWallpaperWithTransition(futureWallpaper) + break + } + // Mark startup transition complete + isStartupTransition = false + } } } } diff --git a/Modules/Panels/Settings/Tabs/WallpaperTab.qml b/Modules/Panels/Settings/Tabs/WallpaperTab.qml index ec3995a0..fd128fea 100644 --- a/Modules/Panels/Settings/Tabs/WallpaperTab.qml +++ b/Modules/Panels/Settings/Tabs/WallpaperTab.qml @@ -205,6 +205,15 @@ ColumnLayout { onSelected: key => Settings.data.wallpaper.transitionType = key } + // Startup Transition Type + NComboBox { + label: I18n.tr("settings.wallpaper.look-feel.startup-transition-type.label") + description: I18n.tr("settings.wallpaper.look-feel.startup-transition-type.description") + model: WallpaperService.transitionsModel + currentKey: Settings.data.wallpaper.startupTransitionType + onSelected: key => Settings.data.wallpaper.startupTransitionType = key + } + // Transition Duration ColumnLayout { NLabel { From dc5292dadbdfb0012c18eeae07f0c5e0fa8aa8e8 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Mon, 10 Nov 2025 17:34:17 +0800 Subject: [PATCH 2/5] Background: optimize wallpaper source size calculation --- Modules/Background/Background.qml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Modules/Background/Background.qml b/Modules/Background/Background.qml index 40fd81ea..8a44e49c 100644 --- a/Modules/Background/Background.qml +++ b/Modules/Background/Background.qml @@ -349,11 +349,23 @@ Variants { // ------------------------------------------------------ function recalculateImageSizes() { + // Re-evaluate and apply optimal sourceSize for both images when ready if (currentWallpaper.status === Image.Ready) { - currentWallpaper.calculateSourceSize() + const optimal = calculateOptimalWallpaperSize(currentWallpaper.implicitWidth, currentWallpaper.implicitHeight) + if (optimal !== undefined && optimal !== false) { + currentWallpaper.sourceSize = optimal + } else { + currentWallpaper.sourceSize = undefined + } } + if (nextWallpaper.status === Image.Ready) { - nextWallpaper.calculateSourceSize() + const optimal2 = calculateOptimalWallpaperSize(nextWallpaper.implicitWidth, nextWallpaper.implicitHeight) + if (optimal2 !== undefined && optimal2 !== false) { + nextWallpaper.sourceSize = optimal2 + } else { + nextWallpaper.sourceSize = undefined + } } } From 02d7a52dd710ad8c679693244ddd456028021ba4 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Mon, 10 Nov 2025 17:43:05 +0800 Subject: [PATCH 3/5] i18n: add ai translations of startup transition - Added "startup-transition-type" key to translations for multiple languages. - Updated descriptions and labels for the new transition type in German, English, Spanish, French, Portuguese, Turkish, Ukrainian, and Chinese. --- Assets/Translations/de.json | 6 +++++- Assets/Translations/en.json | 6 +++++- Assets/Translations/es.json | 6 +++++- Assets/Translations/fr.json | 8 ++++++-- Assets/Translations/pt.json | 6 +++++- Assets/Translations/tr.json | 6 +++++- Assets/Translations/uk-UA.json | 6 +++++- Assets/Translations/zh-CN.json | 6 +++++- 8 files changed, 41 insertions(+), 9 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index f1be4512..7ffc3526 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1591,6 +1591,10 @@ "transition-type": { "description": "Animationstyp beim Wechsel zwischen Hintergrundbildern.", "label": "Übergangstyp" + }, + "startup-transition-type": { + "description": "Animationstyp der Hintergrundbildübergänge, der beim Start von Noctalia verwendet wird.", + "label": "Startup-Übergangstyp" } }, "settings": { @@ -1991,4 +1995,4 @@ "title": "WLAN" } } -} +} \ No newline at end of file diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index bd3e9820..686d1394 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1591,6 +1591,10 @@ "transition-type": { "description": "Animation type when switching between wallpapers.", "label": "Transition type" + }, + "startup-transition-type": { + "description": "Wallpaper transition animation type used when Noctalia starts.", + "label": "Startup transition type" } }, "settings": { @@ -1991,4 +1995,4 @@ "title": "Wi-Fi" } } -} +} \ No newline at end of file diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index a68676bb..27b24540 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1591,6 +1591,10 @@ "transition-type": { "description": "Tipo de animación al cambiar entre fondos de pantalla.", "label": "Tipo de transición" + }, + "startup-transition-type": { + "description": "Tipo de animación de transición de fondo de pantalla que se usa cuando se inicia Noctalia.", + "label": "Tipo de transición al iniciar" } }, "settings": { @@ -1991,4 +1995,4 @@ "title": "Wi-Fi" } } -} +} \ No newline at end of file diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index c4ca352f..c3cb4319 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1589,8 +1589,12 @@ "label": "Durée de la transition" }, "transition-type": { - "description": "Type d'animation lors du changement de fond d'écran.", + "description": "Type d'animation lors du changement de fonds d'écran.", "label": "Type de transition" + }, + "startup-transition-type": { + "description": "Type d'animation de transition de papier peint utilisée au démarrage de Noctalia.", + "label": "Type de transition au démarrage" } }, "settings": { @@ -1991,4 +1995,4 @@ "title": "Wi-Fi" } } -} +} \ No newline at end of file diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 46d05463..0578eb75 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1591,6 +1591,10 @@ "transition-type": { "description": "Tipo de animação ao alternar entre papéis de parede.", "label": "Tipo de transição" + }, + "startup-transition-type": { + "description": "Tipo de animação de transição de papel de parede usado quando o Noctalia é iniciado.", + "label": "Tipo de transição na inicialização" } }, "settings": { @@ -1991,4 +1995,4 @@ "title": "Wi-Fi" } } -} +} \ No newline at end of file diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 5aa2474f..5abbf692 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -1591,6 +1591,10 @@ "transition-type": { "description": "Duvar kağıtları arasında geçiş yaparken animasyon türü.", "label": "Geçiş türü" + }, + "startup-transition-type": { + "description": "Noctalia başlatıldığında kullanılan duvar kağıdı geçiş animasyonu türü.", + "label": "Başlangıç geçiş türü" } }, "settings": { @@ -1991,4 +1995,4 @@ "title": "Wi-Fi" } } -} +} \ No newline at end of file diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index fbcead9d..bf294d22 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -1591,6 +1591,10 @@ "transition-type": { "description": "Тип анімації при перемиканні між шпалерами.", "label": "Тип переходу" + }, + "startup-transition-type": { + "description": "Тип анімації переходу шпалер, що використовується при запуску Noctalia.", + "label": "Тип переходу при запуску" } }, "settings": { @@ -1991,4 +1995,4 @@ "title": "Wi-Fi" } } -} +} \ No newline at end of file diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 3b899fec..0db72330 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1591,6 +1591,10 @@ "transition-type": { "description": "切换壁纸时的动画类型。", "label": "过渡类型" + }, + "startup-transition-type": { + "description": "在 Noctalia 启动时使用的壁纸过渡动画类型。", + "label": "启动时过渡类型" } }, "settings": { @@ -1991,4 +1995,4 @@ "title": "Wi-Fi" } } -} +} \ No newline at end of file From ff8e19d573ad83ee4820608f9ae1175efb9c9586 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Mon, 10 Nov 2025 21:48:23 +0800 Subject: [PATCH 4/5] Revert "i18n: add ai translations of startup transition" This reverts commit 02d7a52dd710ad8c679693244ddd456028021ba4. --- Assets/Translations/de.json | 6 +----- Assets/Translations/en.json | 6 +----- Assets/Translations/es.json | 6 +----- Assets/Translations/fr.json | 8 ++------ Assets/Translations/pt.json | 6 +----- Assets/Translations/tr.json | 6 +----- Assets/Translations/uk-UA.json | 6 +----- Assets/Translations/zh-CN.json | 6 +----- 8 files changed, 9 insertions(+), 41 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 7ffc3526..f1be4512 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1591,10 +1591,6 @@ "transition-type": { "description": "Animationstyp beim Wechsel zwischen Hintergrundbildern.", "label": "Übergangstyp" - }, - "startup-transition-type": { - "description": "Animationstyp der Hintergrundbildübergänge, der beim Start von Noctalia verwendet wird.", - "label": "Startup-Übergangstyp" } }, "settings": { @@ -1995,4 +1991,4 @@ "title": "WLAN" } } -} \ No newline at end of file +} diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 686d1394..bd3e9820 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1591,10 +1591,6 @@ "transition-type": { "description": "Animation type when switching between wallpapers.", "label": "Transition type" - }, - "startup-transition-type": { - "description": "Wallpaper transition animation type used when Noctalia starts.", - "label": "Startup transition type" } }, "settings": { @@ -1995,4 +1991,4 @@ "title": "Wi-Fi" } } -} \ No newline at end of file +} diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 27b24540..a68676bb 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1591,10 +1591,6 @@ "transition-type": { "description": "Tipo de animación al cambiar entre fondos de pantalla.", "label": "Tipo de transición" - }, - "startup-transition-type": { - "description": "Tipo de animación de transición de fondo de pantalla que se usa cuando se inicia Noctalia.", - "label": "Tipo de transición al iniciar" } }, "settings": { @@ -1995,4 +1991,4 @@ "title": "Wi-Fi" } } -} \ No newline at end of file +} diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index c3cb4319..c4ca352f 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1589,12 +1589,8 @@ "label": "Durée de la transition" }, "transition-type": { - "description": "Type d'animation lors du changement de fonds d'écran.", + "description": "Type d'animation lors du changement de fond d'écran.", "label": "Type de transition" - }, - "startup-transition-type": { - "description": "Type d'animation de transition de papier peint utilisée au démarrage de Noctalia.", - "label": "Type de transition au démarrage" } }, "settings": { @@ -1995,4 +1991,4 @@ "title": "Wi-Fi" } } -} \ No newline at end of file +} diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 0578eb75..46d05463 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1591,10 +1591,6 @@ "transition-type": { "description": "Tipo de animação ao alternar entre papéis de parede.", "label": "Tipo de transição" - }, - "startup-transition-type": { - "description": "Tipo de animação de transição de papel de parede usado quando o Noctalia é iniciado.", - "label": "Tipo de transição na inicialização" } }, "settings": { @@ -1995,4 +1991,4 @@ "title": "Wi-Fi" } } -} \ No newline at end of file +} diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 5abbf692..5aa2474f 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -1591,10 +1591,6 @@ "transition-type": { "description": "Duvar kağıtları arasında geçiş yaparken animasyon türü.", "label": "Geçiş türü" - }, - "startup-transition-type": { - "description": "Noctalia başlatıldığında kullanılan duvar kağıdı geçiş animasyonu türü.", - "label": "Başlangıç geçiş türü" } }, "settings": { @@ -1995,4 +1991,4 @@ "title": "Wi-Fi" } } -} \ No newline at end of file +} diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index bf294d22..fbcead9d 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -1591,10 +1591,6 @@ "transition-type": { "description": "Тип анімації при перемиканні між шпалерами.", "label": "Тип переходу" - }, - "startup-transition-type": { - "description": "Тип анімації переходу шпалер, що використовується при запуску Noctalia.", - "label": "Тип переходу при запуску" } }, "settings": { @@ -1995,4 +1991,4 @@ "title": "Wi-Fi" } } -} \ No newline at end of file +} diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 0db72330..3b899fec 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1591,10 +1591,6 @@ "transition-type": { "description": "切换壁纸时的动画类型。", "label": "过渡类型" - }, - "startup-transition-type": { - "description": "在 Noctalia 启动时使用的壁纸过渡动画类型。", - "label": "启动时过渡类型" } }, "settings": { @@ -1995,4 +1991,4 @@ "title": "Wi-Fi" } } -} \ No newline at end of file +} From 71ad86dd6fc190c21b9d3557b567e15e42c6a527 Mon Sep 17 00:00:00 2001 From: Sighthesia Date: Mon, 10 Nov 2025 22:03:57 +0800 Subject: [PATCH 5/5] Background: remove the setting of startup wallpaper transition --- Assets/settings-default.json | 1 - Commons/Settings.qml | 1 - Modules/Background/Background.qml | 17 ++++++++--------- Modules/Panels/Settings/Tabs/WallpaperTab.qml | 9 --------- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 88e7c4fd..add3d975 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -120,7 +120,6 @@ "randomIntervalSec": 300, "transitionDuration": 1500, "transitionType": "random", - "startupTransitionType": "disc", "transitionEdgeSmoothness": 0.05, "monitors": [], "panelPosition": "follow_bar" diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 861be375..3d7be7f1 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -258,7 +258,6 @@ Singleton { property int randomIntervalSec: 300 // 5 min property int transitionDuration: 1500 // 1500 ms property string transitionType: "random" - property string startupTransitionType: "disc" property real transitionEdgeSmoothness: 0.05 property list monitors: [] property string panelPosition: "follow_bar" diff --git a/Modules/Background/Background.qml b/Modules/Background/Background.qml index 8a44e49c..14907cc7 100644 --- a/Modules/Background/Background.qml +++ b/Modules/Background/Background.qml @@ -478,23 +478,22 @@ Variants { // Dedicated function for startup animation function performStartupTransition() { // Get the transitionType from the settings - var transitionSettingType = Settings.data.wallpaper.startupTransitionType + transitionType = Settings.data.wallpaper.transitionType - if (transitionSettingType == "random") { - var idx = Math.floor(Math.random() * allTransitions.length) - transitionSettingType = allTransitions[idx] + if (transitionType == "random") { + var index = Math.floor(Math.random() * allTransitions.length) + transitionType = allTransitions[index] } // Ensure the transition type really exists - if (transitionSettingType !== "none" && !allTransitions.includes(transitionSettingType)) { - transitionSettingType = "fade" + if (transitionType !== "none" && !allTransitions.includes(transitionType)) { + transitionType = "fade" } // Apply transitionType so the shader loader picks the correct shader - this.transitionType = transitionSettingType + this.transitionType = transitionType - // Perform the chosen transition; for startup prefer centered disc when disc selected - switch (transitionSettingType) { + switch (transitionType) { case "none": setWallpaperImmediate(futureWallpaper) break diff --git a/Modules/Panels/Settings/Tabs/WallpaperTab.qml b/Modules/Panels/Settings/Tabs/WallpaperTab.qml index fd128fea..ec3995a0 100644 --- a/Modules/Panels/Settings/Tabs/WallpaperTab.qml +++ b/Modules/Panels/Settings/Tabs/WallpaperTab.qml @@ -205,15 +205,6 @@ ColumnLayout { onSelected: key => Settings.data.wallpaper.transitionType = key } - // Startup Transition Type - NComboBox { - label: I18n.tr("settings.wallpaper.look-feel.startup-transition-type.label") - description: I18n.tr("settings.wallpaper.look-feel.startup-transition-type.description") - model: WallpaperService.transitionsModel - currentKey: Settings.data.wallpaper.startupTransitionType - onSelected: key => Settings.data.wallpaper.startupTransitionType = key - } - // Transition Duration ColumnLayout { NLabel {