diff --git a/CHANGELOG.md b/CHANGELOG.md index 185a31f..6921bd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ All notable changes to MacDirStat are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/), and the project uses [semantic versioning](https://semver.org/). -## [0.7.0] — not yet released +## [0.7.0] — 2026-11-07 -Release notes for the GitHub Release: [`docs/release-notes/v0.7.0.md`](docs/release-notes/v0.7.0.md). +Release notes: [`docs/release-notes/v0.7.0.md`](docs/release-notes/v0.7.0.md). ### Added - **The inventory.** The Cleanup window now has two columns. *Can be rebuilt* groups the cleanup diff --git a/assets/icon/AppIcon.icns b/assets/icon/AppIcon.icns index 10aed65..aa5e682 100644 Binary files a/assets/icon/AppIcon.icns and b/assets/icon/AppIcon.icns differ diff --git a/assets/icon/icon-256.png b/assets/icon/icon-256.png index 656068e..4783e84 100644 Binary files a/assets/icon/icon-256.png and b/assets/icon/icon-256.png differ diff --git a/docs/release-notes/v0.7.0.md b/docs/release-notes/v0.7.0.md index a91c76d..9c2f8da 100644 --- a/docs/release-notes/v0.7.0.md +++ b/docs/release-notes/v0.7.0.md @@ -1,13 +1,5 @@ # MacDirStat 0.7.0 -Draft for Pavol. Not published. To release: check the app on a Mac, then -`git tag v0.7.0 && git push origin v0.7.0` (the version in `Cargo.toml` is already 0.7.0). -The release workflow writes GitHub's generated notes, not this file; once it has run, replace -them with everything below the line: `gh release edit v0.7.0 --notes-file `. Put the date in CHANGELOG.md's 0.7.0 heading at the same time. - ---- - This release changes how MacDirStat looks and what it asks you to decide. It is still free, still reads your disk only on your Mac, and still deletes nothing until you confirm. diff --git a/scripts/make-icon.sh b/scripts/make-icon.sh index 7ee1498..480eda8 100755 --- a/scripts/make-icon.sh +++ b/scripts/make-icon.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Renders assets/icon/icon.svg to assets/icon/AppIcon.icns and the 256px window icon. -# macOS only: qlmanage draws the SVG, sips resizes, iconutil builds the .icns. +# macOS only: render-svg.swift draws the SVG on a transparent canvas (qlmanage fills +# white, which squared off the corners), sips resizes, iconutil builds the .icns. # The outputs are committed; run this only after editing icon.svg. set -euo pipefail @@ -8,9 +9,8 @@ DIR="$(cd "$(dirname "$0")/../assets/icon" && pwd)" WORK="$(mktemp -d)" trap 'rm -rf "$WORK"' EXIT -qlmanage -t -s 1024 -o "$WORK" "$DIR/icon.svg" >/dev/null 2>&1 -BASE="$WORK/icon.svg.png" -[ -f "$BASE" ] || { echo "qlmanage did not render icon.svg" >&2; exit 1; } +BASE="$WORK/icon.png" +swift "$(dirname "$0")/render-svg.swift" "$DIR/icon.svg" "$BASE" 1024 SET="$WORK/AppIcon.iconset" mkdir "$SET" diff --git a/scripts/render-svg.swift b/scripts/render-svg.swift new file mode 100644 index 0000000..cf2948b --- /dev/null +++ b/scripts/render-svg.swift @@ -0,0 +1,19 @@ +// Renders an SVG to a PNG with a transparent background (qlmanage fills white). +// Usage: swift scripts/render-svg.swift in.svg out.png 1024 +// Exits 1 if the top-left pixel is not transparent, so a white-cornered icon can't ship. +import AppKit + +let a = CommandLine.arguments +let size = Int(a[3])! +guard let svg = NSImage(contentsOf: URL(fileURLWithPath: a[1])) else { fatalError("cannot read \(a[1])") } +let rep = NSBitmapImageRep(bitmapDataPlanes: nil, pixelsWide: size, pixelsHigh: size, bitsPerSample: 8, + samplesPerPixel: 4, hasAlpha: true, isPlanar: false, + colorSpaceName: .deviceRGB, bytesPerRow: 0, bitsPerPixel: 0)! +NSGraphicsContext.saveGraphicsState() +NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: rep) +NSColor.clear.set() +NSRect(x: 0, y: 0, width: size, height: size).fill() +svg.draw(in: NSRect(x: 0, y: 0, width: size, height: size)) +NSGraphicsContext.restoreGraphicsState() +try! rep.representation(using: .png, properties: [:])!.write(to: URL(fileURLWithPath: a[2])) +if rep.colorAt(x: 0, y: 0)!.alphaComponent > 0.01 { print("corner is not transparent"); exit(1) }