add setTrayIcon function

This commit is contained in:
QuickMythril 2021-06-27 03:44:29 -04:00 committed by GitHub
parent ceb3969c8b
commit a78ff08202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,6 +289,25 @@ public class SysTray {
this.trayIcon.setToolTip(text);
}
public void setTrayIcon(int iconid) {
if (trayIcon != null) {
switch (iconid) {
case 1:
this.trayIcon.setImage(Gui.loadImage("icons/icon32c.png"));
break;
case 2:
this.trayIcon.setImage(Gui.loadImage("icons/icon32m.png"));
break;
case 3:
this.trayIcon.setImage(Gui.loadImage("icons/icon32n.png"));
break;
case 4:
this.trayIcon.setImage(Gui.loadImage("icons/icon32.png"));
break;
}
}
}
public void dispose() {
if (trayIcon != null)
SystemTray.getSystemTray().remove(this.trayIcon);