Polished settings mechanism
* Set initial value of onCloseMode setting to true * Added setting change handlers * Applying settings changes immediately * Made PrimaryToggleSwitch round
This commit is contained in:
@ -143,8 +143,7 @@ public class Startup {
|
||||
new StatusTrayIcon(chatWindow).show();
|
||||
|
||||
// If the tray icon is supported and corresponding settings is set, hide the chat window on close
|
||||
if (Settings.getInstance().getCurrentOnCloseMode())
|
||||
chatWindow.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
|
||||
Settings.getInstance().getItems().get("onCloseMode").setChangeHandler((onCloseMode) -> chatWindow.setDefaultCloseOperation((boolean) onCloseMode ? JFrame.HIDE_ON_CLOSE : JFrame.EXIT_ON_CLOSE));
|
||||
} catch (EnvoyException e) {
|
||||
logger.warning("The StatusTrayIcon is not supported on this platform!");
|
||||
}
|
||||
|
Reference in New Issue
Block a user