mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-11 03:57:23 +01:00
More UI tweaks and fixes (#697)
* Integrations to window * Cleanup of presenting. * Older name for copy * For copyable view too
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import SwiftUI
|
||||
|
||||
struct WindowBackgroundStyleModifier: ViewModifier {
|
||||
|
||||
let shapeStyle: any ShapeStyle
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
if #available(macOS 15.0, *) {
|
||||
content
|
||||
.containerBackground(
|
||||
shapeStyle, for: .window
|
||||
)
|
||||
} else {
|
||||
content
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension View {
|
||||
|
||||
func windowBackgroundStyle(_ style: some ShapeStyle) -> some View {
|
||||
modifier(WindowBackgroundStyleModifier(shapeStyle: style))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct HiddenToolbarModifier: ViewModifier {
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
if #available(macOS 15.0, *) {
|
||||
content
|
||||
.toolbarBackgroundVisibility(.hidden, for: .automatic)
|
||||
} else {
|
||||
content
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension View {
|
||||
|
||||
func hiddenToolbar() -> some View {
|
||||
modifier(HiddenToolbarModifier())
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user