Improves helder
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import SwiftUI
|
||||
|
||||
/// The frame every overlay sits in: a flat ink scrim (no blur) and a `panel` card with a hairline border,
|
||||
/// radius 8 and the overlay shadow. `.inset` fills the window minus 34pt; `.sized` centres a fixed-width card
|
||||
/// radius 8 and the overlay shadow. `.inset` fills the window minus 34pt, up to 1200pt wide; `.sized` centres a fixed-width card
|
||||
/// at the top. A click on the scrim calls `onDismiss`.
|
||||
public struct OverlayShell<Content: View>: View {
|
||||
public enum Placement {
|
||||
/// Search, Diff: the whole window minus the 34pt inset.
|
||||
/// Search, Diff: the whole window minus the 34pt inset, at most `insetOverlayMaxWidth` wide.
|
||||
case inset
|
||||
/// A card of this width, top-aligned inside the inset.
|
||||
case sized(width: CGFloat)
|
||||
@@ -36,7 +36,7 @@ public struct OverlayShell<Content: View>: View {
|
||||
switch placement {
|
||||
case .inset:
|
||||
OverlayCard { content }
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.frame(maxWidth: Metrics.insetOverlayMaxWidth, maxHeight: .infinity)
|
||||
case let .sized(width):
|
||||
OverlayCard { content }
|
||||
.frame(width: width)
|
||||
|
||||
Reference in New Issue
Block a user