Use separate icons for windows and linux

This commit is contained in:
Manfred Karrer 2014-11-13 21:12:49 +01:00
parent 2be612513f
commit ff0b4c46d1
4 changed files with 18 additions and 5 deletions

View File

@ -26,6 +26,7 @@ import io.bitsquare.gui.components.Popups;
import io.bitsquare.gui.util.ImageUtil;
import io.bitsquare.persistence.Persistence;
import io.bitsquare.user.User;
import io.bitsquare.util.Utilities;
import com.google.common.base.Throwables;
@ -122,8 +123,17 @@ public class BitsquareApp extends Application {
primaryStage.setScene(scene);
primaryStage.setMinWidth(75);
primaryStage.setMinHeight(50);
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(
ImageUtil.isRetina() ? "/images/window_icon@2x.png" : "/images/window_icon.png")));
// on windows the title icon is also used as task bar icon in a larger size
// on Linux no title icon is supported but also a large task bar icon is derived form that title icon
String iconPath;
if (Utilities.isOSX())
iconPath = ImageUtil.isRetina() ? "/images/window_icon@2x.png" : "/images/window_icon.png";
else
iconPath = "/images/taskbar_icon.png";
if (iconPath != null)
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(iconPath)));
// make the UI visible

View File

@ -42,8 +42,9 @@ public class SystemTray {
private static final String ICON_HI_RES = "/images/system_tray_icon@2x.png";
private static final String ICON_LO_RES = "/images/system_tray_icon.png";
private static final String ICON_ALT = "/images/system_tray_icon_alt.png";
private static final String ICON_WINDOWS = "/images/system_tray_icon_windows.png";
private static final String ICON_LINUX = "/images/system_tray_icon_linux.png";
private static final String SHOW_WINDOW_LABEL = "Show exchange window";
private static final String HIDE_WINDOW_LABEL = "Hide exchange window";
@ -82,8 +83,10 @@ public class SystemTray {
String path;
if (Utilities.isOSX())
path = ImageUtil.isRetina() ? ICON_HI_RES : ICON_LO_RES;
else if (Utilities.isWindows())
path = ICON_WINDOWS;
else
path = ICON_ALT;
path = ICON_LINUX;
try {
BufferedImage trayIconImage = ImageIO.read(getClass().getResource(path));

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB