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.

minimumTarget() keeps its label's height

Țugui Dragoșaa43fbc51b63
diff --git a/Peel/Views/MinimumTarget.swift b/Peel/Views/MinimumTarget.swift
index 7ddc36ae..f57de898 100644
--- a/Peel/Views/MinimumTarget.swift
+++ b/Peel/Views/MinimumTarget.swift
@@ -5,6 +5,9 @@ extension View {
/// that whole area clickable. Use it on a button whose label draws smaller, such as a borderless button's text.
func minimumTarget() -> some View {
frame(minWidth: 20, minHeight: 20)
+ // A frame with only a minimum takes any smaller height it is offered, so a label that wraps would
+ // be drawn over whatever sits under it. The target keeps the label's own height instead.
+ .fixedSize(horizontal: false, vertical: true)
.contentShape(.rect)
}
}