diff --git a/apps/desktopgui/build.xml b/apps/desktopgui/build.xml index 1629eeef43cd1d13ea0bd723a177e2d11bd261f5..1a1c9105e3cc52bb8cf557eb8e8451b70965b261 100644 --- a/apps/desktopgui/build.xml +++ b/apps/desktopgui/build.xml @@ -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"/> diff --git a/apps/desktopgui/images/itoopie_black_24.png b/apps/desktopgui/images/itoopie_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..ee108ab34c765a94304bc7928c820ffcc6d990a0 Binary files /dev/null and b/apps/desktopgui/images/itoopie_black_24.png differ diff --git a/apps/desktopgui/images/itoopie_white_24.png b/apps/desktopgui/images/itoopie_white_24.png new file mode 100644 index 0000000000000000000000000000000000000000..61c0c28f5195ba12ab8c00d733b4b76f7da3069f Binary files /dev/null and b/apps/desktopgui/images/itoopie_white_24.png differ diff --git a/apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java b/apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java index 6217e8d88bc430379ee0976b373f9b1d12a619d1..fc2c7b59eda2589e539d62ad17c529400a3c7353 100644 --- a/apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java +++ b/apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java @@ -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; }