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.

About in the main window scrolls when the window is too short for it

Țugui Dragoșac524ad5c88a
diff --git a/Peel/Views/DetailPlaceholder.swift b/Peel/Views/DetailPlaceholder.swift
index a9c2ce8a..050216e2 100644
--- a/Peel/Views/DetailPlaceholder.swift
+++ b/Peel/Views/DetailPlaceholder.swift
@@ -1,15 +1,17 @@
import SwiftUI
extension View {
- /// Centers this on a surface that covers its column from top to bottom.
+ /// Centers this on a surface that covers its column from top to bottom, and scrolls it when the column is
+ /// shorter than it.
///
- /// The empty list is that surface. A pane whose root is a plain view paints nothing of its own, so the
- /// surface changes at the title bar, and that edge reads as a line across the pane. A scroll view with its
- /// background hidden covers the whole column instead, so no line shows.
+ /// A pane whose root is a plain view paints nothing of its own, so the surface changes at the title bar, and
+ /// that edge reads as a line across the pane. A scroll view covers the whole column instead, so no line shows.
func centeredOnColumn() -> some View {
- List {}
- .scrollContentBackground(.hidden)
- .overlay { self }
+ ScrollView {
+ frame(maxWidth: .infinity)
+ }
+ .defaultScrollAnchor(.center, for: .alignment)
+ .scrollBounceBehavior(.basedOnSize)
}
}