From 29053b4d36ccca4b7082759f52e42337cbd6d8b5 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Fri, 24 Jul 2020 10:25:35 +0200 Subject: [PATCH] Apply suggestions from code review --- client/src/main/java/envoy/client/data/Settings.java | 2 +- client/src/main/java/envoy/client/ui/StatusTrayIcon.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/main/java/envoy/client/data/Settings.java b/client/src/main/java/envoy/client/data/Settings.java index 239175d..d511553 100644 --- a/client/src/main/java/envoy/client/data/Settings.java +++ b/client/src/main/java/envoy/client/data/Settings.java @@ -129,7 +129,7 @@ public class Settings { /** * Sets the current on close mode. * - * @param hideOnClose the on close mode that should be set. + * @param hideOnClose whether the application should be minimized on close * @since Envoy Client v0.3-alpha */ public void setHideOnClose(boolean hideOnClose) { ((SettingsItem) items.get("hideOnClose")).set(hideOnClose); } diff --git a/client/src/main/java/envoy/client/ui/StatusTrayIcon.java b/client/src/main/java/envoy/client/ui/StatusTrayIcon.java index 9555117..10c5300 100644 --- a/client/src/main/java/envoy/client/ui/StatusTrayIcon.java +++ b/client/src/main/java/envoy/client/ui/StatusTrayIcon.java @@ -34,7 +34,7 @@ public class StatusTrayIcon { private boolean displayMessages = false; /** - * @return true if the status tray icon is supported on this platform + * @return {@code true} if the status tray icon is supported on this platform * @since Envoy Client v0.2-beta */ public static boolean isSupported() { return SystemTray.isSupported(); } @@ -43,7 +43,7 @@ public class StatusTrayIcon { * Creates a {@link StatusTrayIcon} with the Envoy logo, a tool tip and a pop-up * menu. * - * @param stage the stage which focus determines if message + * @param stage the stage whose focus determines if message * notifications are displayed * @since Envoy Client v0.2-beta */ @@ -61,7 +61,7 @@ public class StatusTrayIcon { trayIcon.setPopupMenu(popup); // Only display messages if the stage is not focused - stage.focusedProperty().addListener((ov, onHidden, onShown) -> displayMessages = ov.getValue() == Boolean.FALSE); + stage.focusedProperty().addListener((ov, onHidden, onShown) -> displayMessages = !ov.getValue()); // Show the window if the user clicks on the icon trayIcon.addActionListener(evt -> Platform.runLater(() -> { stage.setIconified(false); stage.toFront(); stage.requestFocus(); }));