mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-14 06:58:19 -05:00
OSX: new Mac OS X only icons
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@856 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
675866043b
commit
bcda464f20
@ -38,9 +38,9 @@ import java.awt.event.ActionListener;
|
||||
* Tray icon handler based on java 1.6
|
||||
*/
|
||||
public class AwtGatewayTray implements DavGatewayTrayInterface {
|
||||
protected static final String TRAY2_PNG = "tray2.png";
|
||||
protected static final String TRAY_ACTIVE_PNG = "tray2.png";
|
||||
protected static final String TRAY_PNG = "tray.png";
|
||||
protected static final String TRAYINACTIVE_PNG = "trayinactive.png";
|
||||
protected static final String TRAY_INACTIVE_PNG = "trayinactive.png";
|
||||
|
||||
protected AwtGatewayTray() {
|
||||
}
|
||||
@ -186,9 +186,9 @@ public class AwtGatewayTray implements DavGatewayTrayInterface {
|
||||
|
||||
// get the SystemTray instance
|
||||
SystemTray tray = SystemTray.getSystemTray();
|
||||
image = DavGatewayTray.loadImage(TRAY_PNG);
|
||||
image2 = DavGatewayTray.loadImage(TRAY2_PNG);
|
||||
inactiveImage = DavGatewayTray.loadImage(TRAYINACTIVE_PNG);
|
||||
image = DavGatewayTray.loadImage(getTrayIconPath());
|
||||
image2 = DavGatewayTray.loadImage(getTrayIconActivePath());
|
||||
inactiveImage = DavGatewayTray.loadImage(getTrayIconInactivePath());
|
||||
|
||||
// create a popup menu
|
||||
PopupMenu popup = new PopupMenu();
|
||||
@ -281,4 +281,16 @@ public class AwtGatewayTray implements DavGatewayTrayInterface {
|
||||
settingsFrame.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getTrayIconPath() {
|
||||
return AwtGatewayTray.TRAY_PNG;
|
||||
}
|
||||
|
||||
protected String getTrayIconActivePath() {
|
||||
return AwtGatewayTray.TRAY_ACTIVE_PNG;
|
||||
}
|
||||
|
||||
protected String getTrayIconInactivePath() {
|
||||
return AwtGatewayTray.TRAY_INACTIVE_PNG;
|
||||
}
|
||||
}
|
||||
|
@ -262,8 +262,8 @@ public class FrameGatewayTray implements DavGatewayTrayInterface {
|
||||
}
|
||||
|
||||
image = DavGatewayTray.loadImage("tray.png");
|
||||
image2 = DavGatewayTray.loadImage(AwtGatewayTray.TRAY2_PNG);
|
||||
inactiveImage = DavGatewayTray.loadImage(AwtGatewayTray.TRAYINACTIVE_PNG);
|
||||
image2 = DavGatewayTray.loadImage(AwtGatewayTray.TRAY_ACTIVE_PNG);
|
||||
inactiveImage = DavGatewayTray.loadImage(AwtGatewayTray.TRAY_INACTIVE_PNG);
|
||||
|
||||
mainFrame = new JFrame();
|
||||
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
@ -26,6 +26,9 @@ import davmail.DavGateway;
|
||||
* Extended Awt tray with OSX extensions.
|
||||
*/
|
||||
public class OSXAwtGatewayTray extends AwtGatewayTray {
|
||||
protected static final String TRAY_ACTIVE_PNG = "osxtray2.png";
|
||||
protected static final String TRAY_PNG = "osxtray.png";
|
||||
protected static final String TRAYINACTIVE_PNG = "osxtrayinactive.png";
|
||||
/**
|
||||
* Exit DavMail Gateway.
|
||||
*
|
||||
@ -56,4 +59,19 @@ public class OSXAwtGatewayTray extends AwtGatewayTray {
|
||||
DavGatewayTray.error(new BundleMessage("LOG_ERROR_LOADING_OSXADAPTER"), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTrayIconPath() {
|
||||
return OSXAwtGatewayTray.TRAY_PNG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTrayIconActivePath() {
|
||||
return OSXAwtGatewayTray.TRAY_ACTIVE_PNG;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTrayIconInactivePath() {
|
||||
return OSXAwtGatewayTray.TRAYINACTIVE_PNG;
|
||||
}
|
||||
}
|
||||
|
@ -192,10 +192,10 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
|
||||
trayItem = new TrayItem(tray, SWT.NONE);
|
||||
trayItem.setToolTipText(BundleMessage.format("UI_DAVMAIL_GATEWAY"));
|
||||
|
||||
awtImage = DavGatewayTray.loadImage("tray.png");
|
||||
image = loadSwtImage("tray.png");
|
||||
image2 = loadSwtImage(AwtGatewayTray.TRAY2_PNG);
|
||||
inactiveImage = loadSwtImage(AwtGatewayTray.TRAYINACTIVE_PNG);
|
||||
awtImage = DavGatewayTray.loadImage(AwtGatewayTray.TRAY_PNG);
|
||||
image = loadSwtImage(AwtGatewayTray.TRAY_PNG);
|
||||
image2 = loadSwtImage(AwtGatewayTray.TRAY_ACTIVE_PNG);
|
||||
inactiveImage = loadSwtImage(AwtGatewayTray.TRAY_INACTIVE_PNG);
|
||||
|
||||
trayItem.setImage(image);
|
||||
|
||||
|
BIN
src/java/osxtray.png
Normal file
BIN
src/java/osxtray.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 768 B |
BIN
src/java/osxtray2.png
Normal file
BIN
src/java/osxtray2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 749 B |
BIN
src/java/osxtrayinactive.png
Normal file
BIN
src/java/osxtrayinactive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 754 B |
Loading…
Reference in New Issue
Block a user