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
This commit is contained in:
zzz
2016-05-23 18:26:41 +00:00
parent c5432a2098
commit e518e670f2
4 changed files with 16 additions and 2 deletions

View File

@@ -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"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

View File

@@ -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;
}