mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 17:23:25 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user