ADD - separate Home and Lock wallpapers

Store independent Home Screen and Lock Screen wallpaper selections, preserve legacy preferences, and route gallery or camera picks to the selected destination. Add the Settings segmented selector and contract coverage.
This commit is contained in:
Leon.Schmidt
2026-08-15 20:04:45 +02:00
parent f6fb680fbd
commit 14fcfe384d
9 changed files with 152 additions and 31 deletions
@@ -6,8 +6,18 @@ const styles = readFileSync(
new URL('../assets/main.css', import.meta.url),
'utf8',
)
const source = readFileSync(
new URL('./PhoneLockScreen.vue', import.meta.url),
'utf8',
)
describe('PhoneLockScreen notification theme contract', () => {
it('uses the dedicated Lock Screen wallpaper preference', () => {
expect(source).toContain('settings.lockWallpaperImageUrl')
expect(source).toContain('settings.lockWallpaper')
expect(source).not.toContain('settings.wallpaperImageUrl')
})
it('uses explicit light and dark notification material tokens', () => {
expect(styles).toMatch(
/\.lock-screen\s*\{[^}]*--lock-notification-background:\s*rgb\(38 36 40 \/ 76%\)[^}]*--lock-notification-color:\s*#fff/s,
+3 -3
View File
@@ -74,10 +74,10 @@ const time = computed(() =>
.trim(),
)
const dragStyle = computed<Record<string, string>>(() => {
const imageUrl = preferences.value.settings.wallpaperImageUrl
const imageUrl = preferences.value.settings.lockWallpaperImageUrl
return {
'--lock-drag': `${dragOffset.value}px`,
...(preferences.value.settings.wallpaper === 'custom' && imageUrl
...(preferences.value.settings.lockWallpaper === 'custom' && imageUrl
? { '--phone-wallpaper-image': `url(${JSON.stringify(imageUrl)})` }
: {}),
}
@@ -289,7 +289,7 @@ onBeforeUnmount(() => {
<section
class="lock-screen"
:class="[
`wallpaper--${preferences.settings.wallpaper}`,
`wallpaper--${preferences.settings.lockWallpaper}`,
{
'lock-screen--dragging': dragging,
'lock-screen--preview': preview,
@@ -115,7 +115,7 @@ function choosePerformance(mode: GraphicsMode): void {
}
function chooseWallpaper(wallpaper: Exclude<WallpaperId, 'custom'>): void {
phone.setWallpaper(wallpaper)
phone.setWallpaper(wallpaper, null, 'both')
}
function toggleApp(appId: BuiltinPhoneAppId): void {