mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Merge pull request #2467 from devinbileck/bugfix-1996
Fix Windows system tray icon resolution
This commit is contained in:
commit
341b718026
@ -106,11 +106,16 @@ public class SystemTray {
|
||||
try {
|
||||
BufferedImage trayIconImage = ImageIO.read(getClass().getResource(path));
|
||||
TrayIcon trayIcon = new TrayIcon(trayIconImage);
|
||||
// On Windows and Linux the icon needs to be scaled
|
||||
// On Windows and Linux the icon needs to be resized
|
||||
// On macOS we get the correct size from the provided image
|
||||
if (!Utilities.isOSX()) {
|
||||
int trayIconWidth = trayIcon.getSize().width;
|
||||
trayIcon = new TrayIcon(trayIconImage.getScaledInstance(trayIconWidth, -1, Image.SCALE_SMOOTH));
|
||||
if (ImageUtil.isRetina()) {
|
||||
// Using auto sizing provides better results with high resolution
|
||||
trayIcon.setImageAutoSize(true);
|
||||
} else {
|
||||
// Using scaling provides better results with low resolution
|
||||
trayIcon = new TrayIcon(trayIconImage.getScaledInstance(trayIcon.getSize().width, -1, Image.SCALE_SMOOTH));
|
||||
}
|
||||
}
|
||||
|
||||
trayIcon.setPopupMenu(popupMenu);
|
||||
|
Loading…
Reference in New Issue
Block a user