forked from I2P_Developers/i2p.i2p
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:
@@ -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"/>
|
||||
|
BIN
apps/desktopgui/images/itoopie_black_24.png
Normal file
BIN
apps/desktopgui/images/itoopie_black_24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 558 B |
BIN
apps/desktopgui/images/itoopie_white_24.png
Normal file
BIN
apps/desktopgui/images/itoopie_white_24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user