mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-16 20:01:51 +00:00
Added option to quit on closing the window.
This adds a configuration option to quit the app (rather than going to the tray) when the "close" button is clicked.
This commit is contained in:
committed by
Akash Nimare
parent
1da6e5d51d
commit
eb1be7106b
@@ -58,6 +58,7 @@ interface SettingsOptions {
|
||||
};
|
||||
downloadsPath: string;
|
||||
showDownloadFolder: boolean;
|
||||
quitOnClose: boolean;
|
||||
flashTaskbarOnMessage?: boolean;
|
||||
dockBouncing?: boolean;
|
||||
loading?: AnyObject;
|
||||
@@ -206,7 +207,8 @@ class ServerManagerView {
|
||||
silent: false
|
||||
},
|
||||
downloadsPath: `${app.getPath('downloads')}`,
|
||||
showDownloadFolder: false
|
||||
showDownloadFolder: false,
|
||||
quitOnClose: false
|
||||
};
|
||||
|
||||
// Platform specific settings
|
||||
|
||||
@@ -82,6 +82,10 @@ class GeneralSection extends BaseSection {
|
||||
<div class="setting-description">${t.__('Always start minimized')}</div>
|
||||
<div class="setting-control"></div>
|
||||
</div>
|
||||
<div class="setting-row" id="quitOnClose-option">
|
||||
<div class="setting-description">${t.__('Quit when the window is closed')}</div>
|
||||
<div class="setting-control"></div>
|
||||
</div>
|
||||
<div class="setting-row" id="enable-spellchecker-option">
|
||||
<div class="setting-description">${t.__('Enable spellchecker (requires restart)')}</div>
|
||||
<div class="setting-control"></div>
|
||||
@@ -155,6 +159,7 @@ class GeneralSection extends BaseSection {
|
||||
this.removeCustomCSS();
|
||||
this.downloadFolder();
|
||||
this.showDownloadFolder();
|
||||
this.updateQuitOnCloseOption();
|
||||
this.enableErrorReporting();
|
||||
|
||||
// Platform specific settings
|
||||
@@ -321,6 +326,18 @@ class GeneralSection extends BaseSection {
|
||||
});
|
||||
}
|
||||
|
||||
updateQuitOnCloseOption(): void {
|
||||
this.generateSettingOption({
|
||||
$element: document.querySelector('#quitOnClose-option .setting-control'),
|
||||
value: ConfigUtil.getConfigItem('quitOnClose', false),
|
||||
clickHandler: () => {
|
||||
const newValue = !ConfigUtil.getConfigItem('quitOnClose');
|
||||
ConfigUtil.setConfigItem('quitOnClose', newValue);
|
||||
this.updateQuitOnCloseOption();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
enableSpellchecker(): void {
|
||||
this.generateSettingOption({
|
||||
$element: document.querySelector('#enable-spellchecker-option .setting-control'),
|
||||
|
||||
Reference in New Issue
Block a user