forked from dorkbox/SystemTray
Code cleanup
This commit is contained in:
parent
09143f7630
commit
d08904d634
@ -140,7 +140,7 @@ class TrayPopup extends JPopupMenu {
|
||||
hiddenDialog.dispatchEvent(new WindowEvent(hiddenDialog, WindowEvent.WINDOW_CLOSING));
|
||||
}
|
||||
|
||||
void doShow(final MenuImpl systemTray, final Point point, int offset) {
|
||||
void doShow(final Point point, int offset) {
|
||||
Dimension size = getPreferredSize();
|
||||
Rectangle bounds = ScreenUtil.getScreenBoundsAt(point);
|
||||
|
||||
@ -174,19 +174,14 @@ class TrayPopup extends JPopupMenu {
|
||||
|
||||
// critical to get the keyboard listeners working for the popup menu
|
||||
setInvoker(hiddenDialog.getContentPane());
|
||||
|
||||
|
||||
hiddenDialog.setLocation(x, y);
|
||||
hiddenDialog.setVisible(true);
|
||||
|
||||
setLocation(x, y);
|
||||
setVisible(true);
|
||||
|
||||
// when the menu entries are changed, this makes sure to correctly show them
|
||||
invalidate();
|
||||
revalidate();
|
||||
doLayout();
|
||||
|
||||
requestFocusInWindow();
|
||||
|
||||
((EntryImpl) systemTray.getFirst())._native.requestFocusInWindow();
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ class _AppIndicatorTray extends MenuImpl {
|
||||
.getLocation();
|
||||
|
||||
TrayPopup popupMenu = (TrayPopup) _native;
|
||||
popupMenu.doShow(_AppIndicatorTray.this, point, SystemTray.DEFAULT_TRAY_SIZE);
|
||||
popupMenu.doShow(point, SystemTray.DEFAULT_TRAY_SIZE);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -81,7 +81,7 @@ class _GtkStatusIconTray extends MenuImpl {
|
||||
.getLocation();
|
||||
|
||||
TrayPopup popupMenu = (TrayPopup) _native;
|
||||
popupMenu.doShow(_GtkStatusIconTray.this, point, 0);
|
||||
popupMenu.doShow(point, 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -100,7 +100,7 @@ class _SwingTray extends MenuImpl {
|
||||
public
|
||||
void mousePressed(MouseEvent e) {
|
||||
TrayPopup popupMenu = (TrayPopup) _native;
|
||||
popupMenu.doShow(_SwingTray.this, e.getPoint(), 0);
|
||||
popupMenu.doShow(e.getPoint(), 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user