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.

Let the selected pages and scan settings popovers shrink

Țugui Dragoșbae06dc184fa
diff --git a/Peel/Views/CarriedPartsList.swift b/Peel/Views/CarriedPartsList.swift
index 40aaa24f..472fc8f8 100644
--- a/Peel/Views/CarriedPartsList.swift
+++ b/Peel/Views/CarriedPartsList.swift
@@ -11,13 +11,14 @@ struct CarriedPartsList: View {
let page: CarriedSelection.Page
var body: some View {
- // As tall as its rows up to the ceiling Duplicates' scan settings keep, and scrolling past it.
- ViewThatFits(in: .vertical) {
- rows
- ScrollView { rows }
- }
- .frame(width: 340)
- .frame(maxHeight: 460)
+ // As tall as its rows up to the ceiling Duplicates' scan settings keep, and scrolling past it. `fixedSize`
+ // makes the popover shrink when a page is deselected: a frame with only a maximum keeps any larger height
+ // it is offered.
+ ScrollView { rows }
+ .scrollBounceBehavior(.basedOnSize)
+ .frame(width: 340)
+ .frame(maxHeight: 460)
+ .fixedSize(horizontal: false, vertical: true)
}
private var rows: some View {
diff --git a/Peel/Views/Duplicates/DuplicateScanForm.swift b/Peel/Views/Duplicates/DuplicateScanForm.swift
index 6a7f7c1a..dde7f21f 100644
--- a/Peel/Views/Duplicates/DuplicateScanForm.swift
+++ b/Peel/Views/Duplicates/DuplicateScanForm.swift
@@ -61,8 +61,10 @@ struct DuplicateScanForm: View {
.padding([.horizontal, .bottom], 20)
}
.frame(width: 420)
- // The popover grows with the folders listed up to this height, and the list scrolls past it.
+ // The popover grows with the folders listed up to this height, and the list scrolls past it. `fixedSize`
+ // makes it shrink when a folder is removed: a frame with only a maximum keeps any larger height it is offered.
.frame(maxHeight: 460)
+ .fixedSize(horizontal: false, vertical: true)
.fileImporter(
isPresented: $isChoosingFolders,
allowedContentTypes: [.folder],