diff --git a/IceCubesApp/App/IceCubesApp.swift b/IceCubesApp/App/IceCubesApp.swift index f8913ec3..44145c71 100644 --- a/IceCubesApp/App/IceCubesApp.swift +++ b/IceCubesApp/App/IceCubesApp.swift @@ -119,6 +119,7 @@ struct IceCubesApp: App { currentAccount.account?.id != nil { Divider().edgesIgnoringSafeArea(.all) NotificationsTab(popToRootTab: $popToRootTab, lockedType: nil, isSecondaryColumn: true) + .environment(\.isSecondaryColumn, true) .frame(maxWidth: 360) } } diff --git a/Packages/Env/Sources/Env/CustomEnvValues.swift b/Packages/Env/Sources/Env/CustomEnvValues.swift new file mode 100644 index 00000000..cd253093 --- /dev/null +++ b/Packages/Env/Sources/Env/CustomEnvValues.swift @@ -0,0 +1,13 @@ +import Foundation +import SwiftUI + +private struct SecondaryColumnKey: EnvironmentKey { + static let defaultValue = false +} + +extension EnvironmentValues { + public var isSecondaryColumn: Bool { + get { self[SecondaryColumnKey.self] } + set { self[SecondaryColumnKey.self] = newValue } + } +} diff --git a/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift b/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift index 5fc06382..d58b96c3 100644 --- a/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift +++ b/Packages/Status/Sources/Status/Row/StatusMediaPreviewView.swift @@ -7,6 +7,7 @@ import SwiftUI public struct StatusMediaPreviewView: View { @Environment(\.openURL) private var openURL + @Environment(\.isSecondaryColumn) private var isSecondaryColumn @EnvironmentObject var sceneDelegate: SceneDelegate @EnvironmentObject private var preferences: UserPreferences @@ -65,7 +66,7 @@ public struct StatusMediaPreviewView: View { } private func imageSize(from: CGSize, newWidth: CGFloat) -> CGSize { - if isNotifications || theme.statusDisplayStyle == .compact { + if isNotifications || theme.statusDisplayStyle == .compact || isSecondaryColumn { return .init(width: imageMaxHeight, height: imageMaxHeight) } let ratio = newWidth / from.width