mirror of
https://github.com/insidegui/VirtualBuddy.git
synced 2026-12-02 00:59:45 +08:00
* Raise deployment target to macOS 14, bump version * Integrate Liquid Glass compatibility components * Fix onChange(of:) deprecation warnings * Update project settings * Improve styling of setup and configuration UI components * Fix fatal error in VMSavedStatesController.preview * Tweak session UI * Do not use prominent button style in VM configuration sheet so it matches overall setup wizard style * Fix incorrectly sized buttons in grouped lists
26 lines
737 B
Swift
26 lines
737 B
Swift
import SwiftUI
|
|
|
|
/// This is a naive implementation that may not work with every type of shape.
|
|
public struct AnyInsettableShape: InsettableShape {
|
|
private var shape: AnyShape
|
|
private var inset: CGFloat = 0
|
|
|
|
private init(shape: AnyShape, inset: CGFloat) {
|
|
self.shape = shape
|
|
self.inset = inset
|
|
}
|
|
|
|
public init(_ shape: some InsettableShape) {
|
|
self.init(shape: AnyShape(shape), inset: 0)
|
|
}
|
|
|
|
public nonisolated func path(in rect: CGRect) -> Path {
|
|
let path = shape.path(in: rect.insetBy(dx: inset, dy: inset))
|
|
return path
|
|
}
|
|
|
|
public nonisolated func inset(by amount: CGFloat) -> some InsettableShape {
|
|
AnyInsettableShape(shape: shape, inset: amount)
|
|
}
|
|
}
|