OnCloseMode

* Toggle Switch in general settings effects the onCloseMode of the
window.
* Saving in prefs.
* Styled the general settings screen and added some text.
This commit is contained in:
DieGurke
2019-12-22 21:28:13 +01:00
parent e201ec3da1
commit abe36d999a
4 changed files with 115 additions and 13 deletions

View File

@ -132,7 +132,12 @@ public class Startup {
new StatusTrayIcon(chatWindow).show();
// If the tray icon is supported, hide the chat window on close
chatWindow.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
if(Settings.getInstance().getCurrentOnCloseMode() == 1) {
chatWindow.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
}else {
chatWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
} catch (EnvoyException e) {
logger.warning("The StatusTrayIcon is not supported on this platform!");
}