Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions Sources/DMonteCore/CleanDrive.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ public struct CleanDriveWindowView: View {
/// instant delete shows a visible sweep. Smaller moves scale down proportionally.
private static let fullDrainSeconds: Double = 1.1
@State private var isShowingSettings = false
@State private var isShowingDevJunk = false
private let layout = CleanDriveLayout.current

public init(onQuit: @escaping () -> Void) {
Expand Down Expand Up @@ -394,6 +395,12 @@ public struct CleanDriveWindowView: View {
)
}
}

if isShowingDevJunk {
PreferencesOverlay(cornerRadius: 18) {
CleanDriveDevJunkPanel(onClose: { isShowingDevJunk = false })
}
}
}
.frame(width: layout.windowSize.width, height: layout.windowSize.height)
.frostedPanel(cornerRadius: 18)
Expand Down Expand Up @@ -538,16 +545,37 @@ public struct CleanDriveWindowView: View {
.padding(.top, layout.cleanButtonTopPadding)
}

/// Both secondary actions share one row. Giving developer junk its own line would push the
/// window past its fixed height at scale 1.0, and the panel cannot grow — it is sized by
/// `CleanDriveSizing.preferredSize()`.
private var storageButton: some View {
Button {
NSWorkspace.shared.open(URL(fileURLWithPath: "/System/Applications/Utilities/Disk Utility.app"))
} label: {
Text("Manage Storage...")
.font(.system(size: layout.storageFontSize, weight: .medium))
.underline()
.foregroundStyle(Color.accentColor)
HStack(spacing: layout.footerLinkSpacing) {
Spacer()

Button {
isShowingDevJunk = true
} label: {
Text("Developer Junk...")
.font(.system(size: layout.storageFontSize, weight: .medium))
.underline()
.foregroundStyle(Color.accentColor)
}
.buttonStyle(.plain)
.disabled(isCleaning)
.help("Xcode, npm, Homebrew and other developer caches, listed directory by directory")

Button {
NSWorkspace.shared.open(URL(fileURLWithPath: "/System/Applications/Utilities/Disk Utility.app"))
} label: {
Text("Manage Storage...")
.font(.system(size: layout.storageFontSize, weight: .medium))
.underline()
.foregroundStyle(Color.accentColor)
}
.buttonStyle(.plain)

Spacer()
}
.buttonStyle(.plain)
}

private var selectedSize: UInt64 {
Expand Down Expand Up @@ -785,6 +813,7 @@ private struct CleanDriveLayout {
var cleanButtonTopPadding: CGFloat { 4 * scale }
var buttonCornerRadius: CGFloat { 7 * scale }
var storageFontSize: CGFloat { 12 * scale }
var footerLinkSpacing: CGFloat { 14 * scale }
}

private struct CleanDriveSettingsView: View {
Expand Down
Loading
Loading