Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Keep the title bar clear on macOS 27

Țugui Dragoș3bebfa178d88
diff --git a/Peel/Navigation/TitleBarBackground.swift b/Peel/Navigation/TitleBarBackground.swift
new file mode 100644
index 00000000..ec0d1b7d
--- /dev/null
+++ b/Peel/Navigation/TitleBarBackground.swift
@@ -0,0 +1,15 @@
+import SwiftUI
+
+extension View {
+ /// Keeps the title bar clear on macOS 27, as it is on macOS 26. There the window draws a background behind each
+ /// column's section of the title bar even when nothing is under it; without it, what scrolls beneath the title
+ /// bar is still blurred by the scroll edge effect.
+ @ViewBuilder
+ func clearTitleBar() -> some View {
+ if #available(macOS 27, *) {
+ toolbarBackgroundVisibility(.hidden, for: .windowToolbar)
+ } else {
+ self
+ }
+ }
+}
diff --git a/Peel/Views/ContentView.swift b/Peel/Views/ContentView.swift
index 5a1fe57a..323024f5 100644
--- a/Peel/Views/ContentView.swift
+++ b/Peel/Views/ContentView.swift
@@ -127,6 +127,7 @@ struct ContentView: View {
drawn = Destination(tool: tool, page: page)
}
.quietTitlebarSeparators()
+ .clearTitleBar()
.measuresFrames()
.focusedSceneValue(\.selectedTool, shownTool)
// The page changes only for a bundle that is an app, since any app or web page can send the link.