mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 11:26:11 +00:00
MAC Build: new package UI design (thanks to @ITAYC0HEN) (#986)
* MAC Build: new package UI design (thanks to @ITAYC0HEN) * MAC Build: fixed path bar absence
This commit is contained in:
parent
cf501d2606
commit
636057bd53
11
.travis.yml
11
.travis.yml
@ -77,8 +77,17 @@ after_success:
|
||||
mkdir -p Cutter.app/Contents/Resources/r2/share &&
|
||||
cp -a /usr/local/share/radare2 Cutter.app/Contents/Resources/r2/share/ &&
|
||||
mkdir image && cp -a Cutter.app image/ &&
|
||||
export VOL_NAME="Cutter v${CUTTER_VERSION}" &&
|
||||
export DMG_TMP_FILE="Cutter-v$CUTTER_VERSION-x64.macOS-tmp.dmg" &&
|
||||
export DMG_FILE="Cutter-v$CUTTER_VERSION-x64.macOS.dmg" &&
|
||||
hdiutil create -srcfolder image -volname Cutter -fs HFS+ "$DMG_FILE" &&
|
||||
export SIZE=`du -sh "image" | sed 's/\([0-9\.]*\)M\(.*\)/\1/'` &&
|
||||
export SIZE=`echo "${SIZE} + 10.0" | bc | awk '{print int($1+0.5)}'` &&
|
||||
hdiutil create -srcfolder image -volname "${VOL_NAME}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "$DMG_TMP_FILE" &&
|
||||
export DEVICE=$(hdiutil attach -readwrite -noverify "${DMG_TMP_FILE}" | egrep '^/dev/' | sed 1q | awk '{print $1}') &&
|
||||
sleep 2 &&
|
||||
../scripts/prepare_package_ui_macos.sh "Cutter" "${PWD}/../src/macos/cutter_mac_app.png" "${VOL_NAME}" &&
|
||||
hdiutil detach "${DEVICE}" &&
|
||||
hdiutil convert "${DMG_TMP_FILE}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FILE}" &&
|
||||
export FILE_TO_UPLOAD="$DMG_FILE"
|
||||
; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||
|
56
scripts/prepare_package_ui_macos.sh
Executable file
56
scripts/prepare_package_ui_macos.sh
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [[ $# -eq 3 ]]; then
|
||||
echo "Usage: $0 [App name] [background.png] [Volume name]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
APP_NAME=$1
|
||||
DMG_BACKGROUND_IMG=$2
|
||||
VOL_NAME=$3
|
||||
|
||||
if [[ ! -f ${DMG_BACKGROUND_IMG} ]]; then
|
||||
echo "background not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Adding link to '/Applications'..."
|
||||
pushd /Volumes/"${VOL_NAME}" || exit 1
|
||||
ln -s /Applications " " || exit 1
|
||||
popd || exit 1
|
||||
|
||||
echo "Package background set up..."
|
||||
mkdir /Volumes/"${VOL_NAME}"/.background || exit 1
|
||||
|
||||
cp "${DMG_BACKGROUND_IMG}" /Volumes/"${VOL_NAME}"/.background/ || exit 1
|
||||
|
||||
DMG_BACKGROUND_IMG_BASENAME=$(basename "${DMG_BACKGROUND_IMG}")
|
||||
|
||||
# tell the Finder to resize the window, set the background,
|
||||
# change the icon size, place the icons in the right position, etc.
|
||||
echo '
|
||||
tell application "Finder"
|
||||
tell disk "'${VOL_NAME}'"
|
||||
open
|
||||
set current view of container window to icon view
|
||||
set toolbar visible of container window to false
|
||||
set statusbar visible of container window to false
|
||||
set the bounds of container window to {400, 100, 925, 508}
|
||||
set viewOptions to the icon view options of container window
|
||||
set arrangement of viewOptions to not arranged
|
||||
set icon size of viewOptions to 122
|
||||
set background picture of viewOptions to file ".background:'${DMG_BACKGROUND_IMG_BASENAME}'"
|
||||
set position of item "'${APP_NAME}'.app" of container window to {117, 193}
|
||||
set position of item " " of container window to {411, 193}
|
||||
set position of item ".background" of container window to {1000, 1000}
|
||||
set position of item ".fseventsd" of container window to {1010, 1010}
|
||||
close
|
||||
open
|
||||
update without registering applications
|
||||
delay 2
|
||||
end tell
|
||||
end tell
|
||||
' | osascript || exit 1
|
||||
|
||||
echo "Syncing..."
|
||||
sync || exit 1
|
BIN
src/macos/cutter_mac_app.png
Normal file
BIN
src/macos/cutter_mac_app.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
Loading…
Reference in New Issue
Block a user