diff --git a/Passepartout/App/Platforms/App+iOS.swift b/Passepartout/App/Platforms/App+iOS.swift index ec7f65dc..182f81a3 100644 --- a/Passepartout/App/Platforms/App+iOS.swift +++ b/Passepartout/App/Platforms/App+iOS.swift @@ -42,7 +42,7 @@ extension PassepartoutApp { .onOpenURL { url in ImporterPipe.shared.send([url]) } - .themeLockScreen() + .themeLockScreen(theme) } } } diff --git a/Passepartout/Library/Sources/AppUI/Theme/Theme+UI.swift b/Passepartout/Library/Sources/AppUI/Theme/Theme+UI.swift index 6e46cdae..7a06ec9b 100644 --- a/Passepartout/Library/Sources/AppUI/Theme/Theme+UI.swift +++ b/Passepartout/Library/Sources/AppUI/Theme/Theme+UI.swift @@ -68,7 +68,7 @@ struct ThemeBooleanModalModifier: ViewModifier where Modal: View { modal() .frame(minWidth: modalSize?.width, minHeight: modalSize?.height) .interactiveDismissDisabled(!isInteractive) - .themeLockScreen() + .themeLockScreen(theme) } } @@ -97,7 +97,7 @@ struct ThemeItemModalModifier: ViewModifier where Modal: View, T: Iden modal($0) .frame(minWidth: modalSize?.width, minHeight: modalSize?.height) .interactiveDismissDisabled(!isInteractive) - .themeLockScreen() + .themeLockScreen(theme) } } @@ -129,13 +129,13 @@ struct ThemeBooleanPopoverModifier: ViewModifier where Popover: View { .popover(isPresented: $isPresented) { popover .frame(minWidth: theme.popoverSize?.width, minHeight: theme.popoverSize?.height) - .themeLockScreen() + .themeLockScreen(theme) } } else { content .sheet(isPresented: $isPresented) { popover - .themeLockScreen() + .themeLockScreen(theme) } } } @@ -322,6 +322,9 @@ struct ThemeLockScreenModifier: ViewModifier { @AppStorage(AppPreference.locksInBackground.key) private var locksInBackground = false + @ObservedObject + var theme: Theme + func body(content: Content) -> some View { LockableView( locksInBackground: $locksInBackground, @@ -331,6 +334,7 @@ struct ThemeLockScreenModifier: ViewModifier { lockedContent: LogoView.init, unlockBlock: Self.unlockScreenBlock ) + .environmentObject(theme) } private static func unlockScreenBlock() async -> Bool { diff --git a/Passepartout/Library/Sources/AppUI/Theme/Theme.swift b/Passepartout/Library/Sources/AppUI/Theme/Theme.swift index 18b59ebc..66fa5751 100644 --- a/Passepartout/Library/Sources/AppUI/Theme/Theme.swift +++ b/Passepartout/Library/Sources/AppUI/Theme/Theme.swift @@ -199,8 +199,8 @@ extension View { modifier(ThemeHoverListRowModifier()) } - public func themeLockScreen() -> some View { - modifier(ThemeLockScreenModifier()) + public func themeLockScreen(_ theme: Theme) -> some View { + modifier(ThemeLockScreenModifier(theme: theme)) } public func themeTip(_ text: String, edge: Edge) -> some View {