Changeset e518e67


Ignore:
Timestamp:
May 23, 2016 6:26:41 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
bb8b3ebe
Parents:
c5432a2
Message:

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

Location:
apps/desktopgui
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • apps/desktopgui/build.xml

    rc5432a2 re518e67  
    7676                <!-- ideal for linux: 24x24, but transparency doesn't work -->
    7777                <copy tofile="${build}/desktopgui/resources/images/logo.png" file="../../installer/resources/themes/console/images/itoopie_xsm.png" />
     78                <copy todir="${build}/desktopgui/resources/images" file="images/itoopie_black_24.png" />
     79                <copy todir="${build}/desktopgui/resources/images" file="images/itoopie_white_24.png" />
    7880                <jar basedir="${build}" excludes="messages-src/**" destfile="${dist}/${jar}">
    7981                        <manifest>
  • apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java

    rc5432a2 re518e67  
    3838    ///Our tray icon, or null if unsupported
    3939    protected TrayIcon trayIcon;
     40
     41    private static final String PNG_DIR = "/desktopgui/resources/images/";
     42    private static final String MAC_ICON = "itoopie_black_24.png";
     43    private static final String WIN_ICON = "itoopie_white_24.png";
     44    private static final String LIN_ICON = "logo.png";
    4045
    4146    /**
     
    186191     */
    187192    private Image getTrayImage() throws AWTException {
    188         URL url = getClass().getResource("/desktopgui/resources/images/logo.png");
     193        String img;
     194        if (SystemVersion.isWindows())
     195            img = WIN_ICON;
     196        else if (SystemVersion.isMac())
     197            img = MAC_ICON;
     198        else
     199            img = LIN_ICON;
     200        URL url = getClass().getResource(PNG_DIR + img);
    189201        if (url == null)
    190             throw new AWTException("cannot load tray image");
     202            throw new AWTException("cannot load tray image " + img);
    191203        Image image = Toolkit.getDefaultToolkit().getImage(url);
    192204        return image;
Note: See TracChangeset for help on using the changeset viewer.