mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-26 00:50:38 +00:00
Notifications: Full media size + autoplay
This commit is contained in:
parent
0b96b76641
commit
2b446833da
5 changed files with 14 additions and 2 deletions
|
@ -13,6 +13,10 @@ private struct IsCompact: EnvironmentKey {
|
|||
static let defaultValue: Bool = false
|
||||
}
|
||||
|
||||
private struct IsMediaCompact: EnvironmentKey {
|
||||
static let defaultValue: Bool = false
|
||||
}
|
||||
|
||||
private struct IsModal: EnvironmentKey {
|
||||
static let defaultValue: Bool = false
|
||||
}
|
||||
|
@ -53,6 +57,11 @@ public extension EnvironmentValues {
|
|||
set { self[IsCompact.self] = newValue }
|
||||
}
|
||||
|
||||
var isMediaCompact: Bool {
|
||||
get { self[IsMediaCompact.self] }
|
||||
set { self[IsMediaCompact.self] = newValue }
|
||||
}
|
||||
|
||||
var isModal: Bool {
|
||||
get { self[IsModal.self] }
|
||||
set { self[IsModal.self] = newValue }
|
||||
|
|
|
@ -75,7 +75,7 @@ import SwiftUI
|
|||
@MainActor
|
||||
public struct MediaUIAttachmentVideoView: View {
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
@Environment(\.isCompact) private var isCompact
|
||||
@Environment(\.isMediaCompact) private var isCompact
|
||||
@Environment(UserPreferences.self) private var preferences
|
||||
@Environment(Theme.self) private var theme
|
||||
|
||||
|
|
|
@ -160,6 +160,7 @@ struct NotificationRowView: View {
|
|||
client: client,
|
||||
routerPath: routerPath,
|
||||
showActions: true))
|
||||
.environment(\.isMediaCompact, false)
|
||||
} else {
|
||||
StatusRowView(viewModel: .init(status: status,
|
||||
client: client,
|
||||
|
@ -167,6 +168,7 @@ struct NotificationRowView: View {
|
|||
showActions: false,
|
||||
textDisabled: true))
|
||||
.lineLimit(4)
|
||||
.environment(\.isMediaCompact, true)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ public struct StatusEmbeddedView: View {
|
|||
showActions: false))
|
||||
.accessibilityLabel(status.content.asRawText)
|
||||
.environment(\.isCompact, true)
|
||||
.environment(\.isMediaCompact, true)
|
||||
.environment(\.isStatusFocused, false)
|
||||
}
|
||||
Spacer()
|
||||
|
|
|
@ -10,7 +10,7 @@ import SwiftUI
|
|||
public struct StatusRowMediaPreviewView: View {
|
||||
@Environment(\.openWindow) private var openWindow
|
||||
@Environment(\.extraLeadingInset) private var extraLeadingInset: CGFloat
|
||||
@Environment(\.isCompact) private var isCompact: Bool
|
||||
@Environment(\.isMediaCompact) private var isCompact: Bool
|
||||
@Environment(\.horizontalSizeClass) private var horizontalSizeClass
|
||||
@Environment(SceneDelegate.self) private var sceneDelegate
|
||||
@Environment(UserPreferences.self) private var preferences
|
||||
|
|
Loading…
Reference in a new issue