diff --git a/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java b/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java index abfc65087..8da4bc1ad 100644 --- a/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java +++ b/src/net/java/sip/communicator/impl/systray/jdic/SystrayServiceJdicImpl.java @@ -12,6 +12,7 @@ import java.util.Timer; import javax.swing.*; +import javax.swing.event.*; import net.java.sip.communicator.impl.systray.*; import net.java.sip.communicator.service.configuration.*; @@ -79,6 +80,7 @@ public class SystrayServiceJdicImpl * The various icons used on the systray */ private ImageIcon logoIcon; + private ImageIcon logoIconWhite; private ImageIcon envelopeIcon; /** @@ -117,26 +119,28 @@ private void initSystray() // background. if (osName.startsWith("Windows")) { - logoIcon = new ImageIcon( - Resources.getImage("trayIconWindows")); - envelopeIcon = new ImageIcon( - Resources.getImage("messageIconWindows")); + logoIcon = new ImageIcon( + Resources.getImage("trayIconWindows")); + envelopeIcon = new ImageIcon( + Resources.getImage("messageIconWindows")); } // If we're running under MacOSX, we use a special back and // white icons without background. else if (osName.startsWith("Mac OS X")) { - logoIcon = new ImageIcon( - Resources.getImage("trayIconMacOSX")); - envelopeIcon = new ImageIcon( - Resources.getImage("messageIconMacOSX")); + logoIcon = new ImageIcon( + Resources.getImage("trayIconMacOSX")); + logoIconWhite = new ImageIcon( + Resources.getImage("trayIconMacOSXWhite")); + envelopeIcon = new ImageIcon( + Resources.getImage("messageIconMacOSX")); } else { - logoIcon = new ImageIcon( + logoIcon = new ImageIcon( Resources.getImage("trayIcon")); - envelopeIcon = new ImageIcon( - Resources.getImage("messageIcon")); + envelopeIcon = new ImageIcon( + Resources.getImage("messageIcon")); } trayIcon = new TrayIcon(logoIcon, "SIP Communicator", menu); @@ -164,6 +168,29 @@ public void actionPerformed(ActionEvent e) } }); + // Change the MacOSX icon with the white one when the popup + // menu appears + if (osName.startsWith("Mac OS X")) + { + menu.addPopupMenuListener(new PopupMenuListener() + { + public void popupMenuWillBecomeVisible(PopupMenuEvent e) + { + trayIcon.setIcon(logoIconWhite); + } + + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) + { + trayIcon.setIcon(logoIcon); + } + + public void popupMenuCanceled(PopupMenuEvent e) + { + trayIcon.setIcon(logoIconWhite); + } + }); + } + //Notify all interested listener that user has clicked on the systray //popup message. trayIcon.addBalloonActionListener(new ActionListener() diff --git a/src/net/java/sip/communicator/impl/systray/resources.properties b/src/net/java/sip/communicator/impl/systray/resources.properties index 3a7e0489f..5d9992a4c 100644 --- a/src/net/java/sip/communicator/impl/systray/resources.properties +++ b/src/net/java/sip/communicator/impl/systray/resources.properties @@ -7,6 +7,7 @@ trayIcon=net/java/sip/communicator/impl/systray/resources/systrayIcon.png trayIconWindows=net/java/sip/communicator/impl/systray/resources/systrayIconWindows.png trayIconWindowsAnimated=net/java/sip/communicator/impl/systray/resources/systrayIconWindows.gif trayIconMacOSX=net/java/sip/communicator/impl/systray/resources/systrayIconMacOSX.png +trayIconMacOSXWhite=net/java/sip/communicator/impl/systray/resources/systrayIconMacOSXWhite.png addContactIcon=net/java/sip/communicator/impl/systray/resources/addContactIcon.png statusMenuIcon=net/java/sip/communicator/impl/systray/resources/statusIcon.png settingsMenuIcon=net/java/sip/communicator/impl/systray/resources/configureIcon.png diff --git a/src/net/java/sip/communicator/impl/systray/resources/envelopeMacOSX.png b/src/net/java/sip/communicator/impl/systray/resources/envelopeMacOSX.png index d7d5f3284..916cfcd96 100644 Binary files a/src/net/java/sip/communicator/impl/systray/resources/envelopeMacOSX.png and b/src/net/java/sip/communicator/impl/systray/resources/envelopeMacOSX.png differ diff --git a/src/net/java/sip/communicator/impl/systray/resources/systrayIconMacOSXWhite.png b/src/net/java/sip/communicator/impl/systray/resources/systrayIconMacOSXWhite.png new file mode 100644 index 000000000..50b418c48 Binary files /dev/null and b/src/net/java/sip/communicator/impl/systray/resources/systrayIconMacOSXWhite.png differ diff --git a/src/net/java/sip/communicator/impl/systray/resources_de.properties b/src/net/java/sip/communicator/impl/systray/resources_de.properties index abf77b7b2..648bcc4bd 100644 --- a/src/net/java/sip/communicator/impl/systray/resources_de.properties +++ b/src/net/java/sip/communicator/impl/systray/resources_de.properties @@ -9,6 +9,7 @@ trayIcon=net/java/sip/communicator/impl/systray/resources/systrayIcon.png trayIconWindows=net/java/sip/communicator/impl/systray/resources/systrayIconWindows.png trayIconWindowsAnimated=net/java/sip/communicator/impl/systray/resources/systrayIconWindows.gif trayIconMacOSX=net/java/sip/communicator/impl/systray/resources/systrayIconMacOSX.png +trayIconMacOSXWhite=net/java/sip/communicator/impl/systray/resources/systrayIconMacOSXWhite.png addContactIcon=net/java/sip/communicator/impl/systray/resources/addContactIcon.png statusMenuIcon=net/java/sip/communicator/impl/systray/resources/statusIcon.png settingsMenuIcon=net/java/sip/communicator/impl/systray/resources/configureIcon.png