forked from I2P_Developers/i2p.i2p
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:
@@ -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
|
||||||
|
// so we have a contrasting icon
|
||||||
|
String theme = _appContext.getProperty("routerconsole.theme", "light");
|
||||||
|
if (theme.equals("dark"))
|
||||||
|
img = WIN_ICON_LIGHT;
|
||||||
|
else
|
||||||
|
img = WIN_ICON_DARK;
|
||||||
|
} else if (SystemVersion.isMac()) {
|
||||||
img = MAC_ICON;
|
img = MAC_ICON;
|
||||||
else
|
} 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);
|
||||||
|
|||||||
Reference in New Issue
Block a user