IDEADEV-41971 Clicking background tasks icon (on status bar) doesn't hide window

This commit is contained in:
Alexey Pegov
2009-12-18 17:27:37 +03:00
parent 80af1a1bc2
commit a3277f0efb
2 changed files with 10 additions and 8 deletions
@@ -57,7 +57,7 @@ public class NotificationComponent extends JLabel implements NotificationModelLi
@Override
public void mousePressed(final MouseEvent e) {
if (UIUtil.isActionClick(e)) {
showList();
toggleList();
}
}
});
@@ -97,16 +97,16 @@ public class NotificationComponent extends JLabel implements NotificationModelLi
getManager().addListener(this);
}
private void showList() {
private void toggleList() {
JBPopup popup = null;
if (myPopupRef != null) {
final JBPopup popup = myPopupRef.get();
if (popup != null && !popup.isVisible()) {
myPopupRef = null;
}
else if (popup == null) myPopupRef = null;
popup = myPopupRef.get();
myPopupRef = null;
}
if (myPopupRef == null) {
if (popup != null && popup.isVisible()) {
popup.cancel();
} else {
myPopupRef = new WeakReference<JBPopup>(NotificationsListPanel.show(getProject(), this));
}
}
@@ -86,6 +86,8 @@ public class InfoAndProgressPanel extends JPanel implements StatusBarPatch {
public void mousePressed(MouseEvent e) {
if (!myPopup.isShowing()) {
openProcessPopup();
} else {
hideProcessPopup();
}
}
});