-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add an icon for the GUI application (#1179)
* Test run of application icons. These icons are not final, but meant as a test of the packaging platform. * Try adding an in-app icon. * Actually add the image. * Add defensive null check. * Update Mac OS icon. * Add the application icon SVG source. * Add a helper script for Mac icon creation. * Update Windows icon + add conversion script. * Update Mac OS icon. * Update core icon with better background transparency. * Update Windows icon, including more intermediate resolutions in the ico file. * Support different resolution icons within the app JFrame. * Support JFrame app icon in multiple resolutions. * Fix typo. * Add README and script updates. * Java format. * Add the --win-console option back in. Co-authored-by: Brian Ferris <bdferris@google.com>
- Loading branch information
1 parent
cec914e
commit da57dbf
Showing
12 changed files
with
229 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+980 Bytes
app/gui/src/main/resources/org/mobilitydata/gtfsvalidator/app/gui/icon_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.51 KB
app/gui/src/main/resources/org/mobilitydata/gtfsvalidator/app/gui/icon_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.61 KB
app/gui/src/main/resources/org/mobilitydata/gtfsvalidator/app/gui/icon_48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Updating Application Icons | ||
|
||
The source file for all application icons is `Icon.svg`. This is used to create three | ||
platform-specific application icons: | ||
|
||
* Windows: `Icon.ico` | ||
* Mac OS: `Icon.icns` | ||
* Java In-App | ||
|
||
When updating the source icon, you can run the following three scripts to regenerate the | ||
relevant icon files from the SVG source: | ||
|
||
* `svg2ico.sh` | ||
* `svg2icsn.sh` | ||
* `svg2jframe_icons.sh` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# | ||
# Helper script for constructing a Mac OS icns icon bundle, | ||
# from an intermediate iconset file bundle. Requires install | ||
# of ImageMagik for `convert` command. | ||
|
||
set -e | ||
|
||
BASEDIR=$(dirname "$0") | ||
SVG=$BASEDIR/Icon.svg | ||
ICONSET_DIR=$BASEDIR/Icon.iconset | ||
|
||
CONFIGS=" | ||
icon_16x16.png,16x16 | ||
icon_16x16@2x.png,32x32 | ||
icon_32x32.png,32x32 | ||
icon_32x32@2x.png,64x64 | ||
icon_128x128.png,128x128 | ||
icon_128x128@2x.png,256x256 | ||
icon_256x256.png,256x256 | ||
icon_256x256@2x.png,512x512 | ||
icon_512x512.png,512x512 | ||
icon_512x512@2x.png,1024x1024 | ||
" | ||
|
||
if [ -e $ICONSET_DIR ]; then | ||
rm -rf "$ICONSET_DIR" | ||
fi | ||
mkdir $ICONSET_DIR | ||
|
||
for CONFIG in $CONFIGS; do | ||
FILENAME=$(echo $CONFIG | cut -d, -f1) | ||
SIZE=$(echo $CONFIG | cut -d, -f2) | ||
echo $FILENAME | ||
convert -density 1200 -background none -resize $SIZE $SVG $ICONSET_DIR/$FILENAME | ||
done | ||
|
||
iconutil -c icns $ICONSET_DIR | ||
rm -rf "$ICONSET_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# | ||
# Helper script for constructing a Windows icon bundle. Requires | ||
# install of ImageMagik for `convert` command. | ||
|
||
set -e | ||
|
||
BASEDIR=$(dirname "$0") | ||
SVG=$BASEDIR/Icon.svg | ||
ICO_DIR=$BASEDIR/Icon.ico_dir | ||
|
||
CONFIGS=" | ||
icon_16x16.png,16x16 | ||
icon_32x32.png,32x32 | ||
icon_48x48.png,48x48 | ||
icon_64x64.png,64x64 | ||
icon_128x128.png,128x128 | ||
icon_256x256.png,256x256 | ||
" | ||
|
||
if [ -e $ICO_DIR ]; then | ||
rm -rf "$ICO_DIR" | ||
fi | ||
mkdir $ICO_DIR | ||
|
||
for CONFIG in $CONFIGS; do | ||
FILENAME=$(echo $CONFIG | cut -d, -f1) | ||
SIZE=$(echo $CONFIG | cut -d, -f2) | ||
echo $FILENAME | ||
convert -density 1200 -background none -resize $SIZE $SVG $ICO_DIR/$FILENAME | ||
done | ||
|
||
convert $ICO_DIR/*.png Icon.ico | ||
rm -rf "$ICO_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# | ||
# Helper script for constructing Java in-app icon resources. Requires | ||
# install of ImageMagik for `convert` command. | ||
|
||
set -e | ||
|
||
BASEDIR=$(dirname "$0") | ||
SVG=$BASEDIR/Icon.svg | ||
|
||
PROJECT_ROOT_DIR=$(git rev-parse --show-toplevel) | ||
RESOURCES_DIR=$PROJECT_ROOT_DIR/app/gui/src/main/resources/org/mobilitydata/gtfsvalidator/app/gui | ||
|
||
CONFIGS=" | ||
icon_16x16.png,16x16 | ||
icon_32x32.png,32x32 | ||
icon_48x48.png,48x48 | ||
" | ||
|
||
for CONFIG in $CONFIGS; do | ||
FILENAME=$(echo $CONFIG | cut -d, -f1) | ||
SIZE=$(echo $CONFIG | cut -d, -f2) | ||
echo $FILENAME | ||
convert -density 1200 -background none -resize $SIZE $SVG $RESOURCES_DIR/$FILENAME | ||
done |