Skip to content

Commit 071a21a

Browse files
committed
finetuning dmg window
1 parent cf955c6 commit 071a21a

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/actions/create-dmg/action.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,17 @@ runs:
3737
# Copy background image if provided and exists
3838
if [ -f "${{ inputs.dmg_background_path }}" ]; then
3939
cp "${{ inputs.dmg_background_path }}" "dmg-stage/background.jpg"
40-
# Resize background to match window size exactly (700x500)
41-
sips -z 500 700 "dmg-stage/background.jpg"
40+
41+
# Check image width to determine if it's Retina (@2x) (1400px)
42+
WIDTH=$(sips -g pixelWidth "dmg-stage/background.jpg" | awk '/pixelWidth/ {print $2}')
43+
44+
if [ "$WIDTH" -gt 700 ]; then
45+
echo "Detected high-resolution background ($WIDTH px width). Setting DPI to 144 for Retina display."
46+
sips -s dpiHeight 144.0 -s dpiWidth 144.0 "dmg-stage/background.jpg"
47+
else
48+
echo "Detected standard-resolution background ($WIDTH px width). Keeping standard DPI."
49+
sips -s dpiHeight 72.0 -s dpiWidth 72.0 "dmg-stage/background.jpg"
50+
fi
4251
else
4352
echo "::warning::Background image not found at ${{ inputs.dmg_background_path }}. DMG will be created without custom background."
4453
fi
@@ -60,6 +69,7 @@ runs:
6069
--icon "CopyShot.app" 180 225
6170
--icon "Applications" 520 225
6271
--hide-extension "CopyShot.app"
72+
--no-toolbar
6373
)
6474
6575
if [ -f "dmg-stage/background.jpg" ]; then
-31.4 KB
Loading

0 commit comments

Comments
 (0)