mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-08-31 01:20:57 +00:00
25 lines
526 B
Swift
25 lines
526 B
Swift
import SwiftUI
|
|
|
|
struct PrimaryButtonModifier: ViewModifier {
|
|
|
|
@Environment(\.colorScheme) var colorScheme
|
|
|
|
func body(content: Content) -> some View {
|
|
// Tinted glass prominent is really hard to read on 26.0.
|
|
if #available(macOS 26.0, *), colorScheme == .dark {
|
|
content.buttonStyle(.glassProminent)
|
|
} else {
|
|
content.buttonStyle(.borderedProminent)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
extension View {
|
|
|
|
func primary() -> some View {
|
|
modifier(PrimaryButtonModifier())
|
|
}
|
|
|
|
}
|