I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit e518e670 authored by zzz's avatar zzz
Browse files

DTG: Add tray icons for Windows and Mac

White icon copied from Android drawable-mdpi/ic_stat_router_active.png for Windows
Converted to black in Gimp for Mac
parent c5432a20
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,8 @@
<property name="workspace.changes.tr" value="" />
<!-- ideal for linux: 24x24, but transparency doesn't work -->
<copy tofile="${build}/desktopgui/resources/images/logo.png" file="../../installer/resources/themes/console/images/itoopie_xsm.png" />
<copy todir="${build}/desktopgui/resources/images" file="images/itoopie_black_24.png" />
<copy todir="${build}/desktopgui/resources/images" file="images/itoopie_white_24.png" />
<jar basedir="${build}" excludes="messages-src/**" destfile="${dist}/${jar}">
<manifest>
<attribute name="Main-Class" value="net.i2p.desktopgui.Main"/>
......
apps/desktopgui/images/itoopie_black_24.png

558 B

apps/desktopgui/images/itoopie_white_24.png

677 B

......@@ -38,6 +38,11 @@ abstract class TrayManager {
///Our tray icon, or null if unsupported
protected TrayIcon trayIcon;
private static final String PNG_DIR = "/desktopgui/resources/images/";
private static final String MAC_ICON = "itoopie_black_24.png";
private static final String WIN_ICON = "itoopie_white_24.png";
private static final String LIN_ICON = "logo.png";
/**
* Instantiate tray manager.
*/
......@@ -185,9 +190,16 @@ abstract class TrayManager {
* @throws AWTException if image not found
*/
private Image getTrayImage() throws AWTException {
URL url = getClass().getResource("/desktopgui/resources/images/logo.png");
String img;
if (SystemVersion.isWindows())
img = WIN_ICON;
else if (SystemVersion.isMac())
img = MAC_ICON;
else
img = LIN_ICON;
URL url = getClass().getResource(PNG_DIR + img);
if (url == null)
throw new AWTException("cannot load tray image");
throw new AWTException("cannot load tray image " + img);
Image image = Toolkit.getDefaultToolkit().getImage(url);
return image;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment