Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Keep a list row's separator under its title beside a status label
Țugui Dragoș079ed1761fff
diff --git a/Peel/Views/LeavesRowSeparatorAlone.swift b/Peel/Views/LeavesRowSeparatorAlone.swiftnew file mode 100644index 00000000..ec864234--- /dev/null+++ b/Peel/Views/LeavesRowSeparatorAlone.swift@@ -0,0 +1,24 @@+import SwiftUI++/// Lays out one view as it is, but never lets it decide where a list row's separator starts. A `Label` marks its+/// title as that start, so a status or a tag beside a row's title would pull the separator under itself.+struct LeavesRowSeparatorAlone: Layout {+ func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize {+ subviews.first?.sizeThatFits(proposal) ?? .zero+ }++ func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) {+ subviews.first?.place(at: bounds.origin, proposal: ProposedViewSize(bounds.size))+ }++ func explicitAlignment(+ of guide: HorizontalAlignment,+ in bounds: CGRect,+ proposal: ProposedViewSize,+ subviews: Subviews,+ cache: inout ()+ ) -> CGFloat? {+ guard guide != .listRowSeparatorLeading, let view = subviews.first else { return nil }+ return view.dimensions(in: ProposedViewSize(bounds.size))[explicit: guide].map { bounds.minX + $0 }+ }+}diff --git a/Peel/Views/StatusLabel.swift b/Peel/Views/StatusLabel.swiftindex fd76fe85..0d455c89 100644--- a/Peel/Views/StatusLabel.swift+++ b/Peel/Views/StatusLabel.swift@@ -8,11 +8,13 @@ struct StatusLabel: View {var tint: Color = .orangevar body: some View {- Label {- title- } icon: {- Image(systemName: systemImage)- .rowTint(tint)+ LeavesRowSeparatorAlone {+ Label {+ title+ } icon: {+ Image(systemName: systemImage)+ .rowTint(tint)+ }}}}