mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-10 01:09:29 +00:00
41 lines
927 B
Swift
41 lines
927 B
Swift
import Foundation
|
|
import SwiftUI
|
|
|
|
private struct SecondaryColumnKey: EnvironmentKey {
|
|
static let defaultValue = false
|
|
}
|
|
|
|
private struct ExtraLeadingInset: EnvironmentKey {
|
|
static let defaultValue: CGFloat = 0
|
|
}
|
|
|
|
private struct IsCompact: EnvironmentKey {
|
|
static let defaultValue: Bool = false
|
|
}
|
|
|
|
private struct IsInCaptureMode: EnvironmentKey {
|
|
static let defaultValue: Bool = false
|
|
}
|
|
|
|
public extension EnvironmentValues {
|
|
var isSecondaryColumn: Bool {
|
|
get { self[SecondaryColumnKey.self] }
|
|
set { self[SecondaryColumnKey.self] = newValue }
|
|
}
|
|
|
|
var extraLeadingInset: CGFloat {
|
|
get { self[ExtraLeadingInset.self] }
|
|
set { self[ExtraLeadingInset.self] = newValue }
|
|
}
|
|
|
|
var isCompact: Bool {
|
|
get { self[IsCompact.self] }
|
|
set { self[IsCompact.self] = newValue }
|
|
}
|
|
|
|
var isInCaptureMode: Bool {
|
|
get { self[IsInCaptureMode.self] }
|
|
set { self[IsInCaptureMode.self] = newValue }
|
|
}
|
|
}
|