DTG: Change icon from white to black on Windows by default

Will be set to the opposite of the console theme.
This commit is contained in:
zzz
2021-12-04 10:48:11 -05:00
parent 962cc31f31
commit fa0e59435e

View File

@@ -46,7 +46,8 @@ abstract class TrayManager {
private static final String PNG_DIR = "/desktopgui/resources/images/"; private static final String PNG_DIR = "/desktopgui/resources/images/";
private static final String MAC_ICON = "itoopie_black_24.png"; private static final String MAC_ICON = "itoopie_black_24.png";
private static final String WIN_ICON = "itoopie_white_24.png"; private static final String WIN_ICON_LIGHT = "itoopie_white_24.png";
private static final String WIN_ICON_DARK = "itoopie_black_24.png";
private static final String LIN_ICON = "logo.png"; private static final String LIN_ICON = "logo.png";
/** /**
@@ -197,12 +198,20 @@ abstract class TrayManager {
*/ */
private Image getTrayImage() throws AWTException { private Image getTrayImage() throws AWTException {
String img; String img;
if (SystemVersion.isWindows()) if (SystemVersion.isWindows()) {
img = WIN_ICON; // too hard to get the theme out of the registry,
else if (SystemVersion.isMac()) // use our console theme as a best guess
img = MAC_ICON; // so we have a contrasting icon
String theme = _appContext.getProperty("routerconsole.theme", "light");
if (theme.equals("dark"))
img = WIN_ICON_LIGHT;
else else
img = WIN_ICON_DARK;
} else if (SystemVersion.isMac()) {
img = MAC_ICON;
} else {
img = LIN_ICON; img = LIN_ICON;
}
URL url = getClass().getResource(PNG_DIR + img); URL url = getClass().getResource(PNG_DIR + img);
if (url == null) if (url == null)
throw new AWTException("cannot load tray image " + img); throw new AWTException("cannot load tray image " + img);