mirror of
https://github.com/finos/SymphonyElectron.git
synced 2026-10-25 14:20:04 -05:00
SDA-4710 - Hide instead of Minimize on Windows (#2419)
This commit is contained in:
1 parent
565725d794
commit
30bcd78027
5 files changed
+38
-3
No files matched your search
@@ -9,7 +9,7 @@ import { i18n } from '../common/i18n';
|
||||
import { logger } from '../common/logger';
|
||||
import { presenceStatusStore } from './stores';
|
||||
import { windowHandler } from './window-handler';
|
||||
import { initSysTray, showBadgeCount } from './window-utils';
|
||||
import { initSysTray, showBadgeCount, windowExists } from './window-utils';
|
||||
|
||||
export interface IListItem {
|
||||
name: string;
|
||||
@@ -133,6 +133,7 @@ class PresenceStatus {
|
||||
}
|
||||
const presenceNamespace = 'PresenceStatus';
|
||||
const isMana = !!windowHandler.isMana;
|
||||
const mainWindow = windowHandler.getMainWindow();
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: i18n.t('Status')(),
|
||||
@@ -211,6 +212,14 @@ class PresenceStatus {
|
||||
},
|
||||
},
|
||||
{ type: 'separator', visible: isMana },
|
||||
{
|
||||
label: i18n.t('Open Symphony Messaging')(),
|
||||
click: () => {
|
||||
if (mainWindow && windowExists(mainWindow)) {
|
||||
mainWindow.show();
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: i18n.t('Quit Symphony Messaging')(),
|
||||
click: () => app.quit(),
|
||||
@@ -233,7 +242,16 @@ class PresenceStatus {
|
||||
'tray',
|
||||
);
|
||||
const tray = presenceStatusStore.getCurrentTray();
|
||||
const mainWindow = windowHandler.getMainWindow();
|
||||
const contextDefault = Menu.buildFromTemplate([
|
||||
{
|
||||
label: i18n.t('Open Symphony Messaging')(),
|
||||
click: () => {
|
||||
if (mainWindow && windowExists(mainWindow)) {
|
||||
mainWindow.show();
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: i18n.t('Quit Symphony Messaging')(),
|
||||
click: () => app.quit(),
|
||||
|
||||
@@ -807,7 +807,7 @@ export class WindowHandler {
|
||||
if (this.mainWindow.isFullScreen()) {
|
||||
hideOrMinimizeFullscreenWindow(this.mainWindow);
|
||||
} else {
|
||||
this.mainWindow.minimize();
|
||||
this.mainWindow.hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
+16
-1
@@ -322,7 +322,16 @@ export const initSysTray = () => {
|
||||
);
|
||||
const backgroundImage = nativeImage.createFromPath(defaultSysTrayIconPath);
|
||||
const tray = new Tray(backgroundImage);
|
||||
const mainWindow = windowHandler.getMainWindow();
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: i18n.t('Open Symphony Messaging')(),
|
||||
click: () => {
|
||||
if (mainWindow && windowExists(mainWindow)) {
|
||||
mainWindow.show();
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: i18n.t('Quit Symphony Messaging')(),
|
||||
click: () => app.quit(),
|
||||
@@ -330,6 +339,12 @@ export const initSysTray = () => {
|
||||
]);
|
||||
tray.setContextMenu(contextMenu);
|
||||
tray.setToolTip(productDisplayName);
|
||||
tray.on('click', () => {
|
||||
if (mainWindow && windowExists(mainWindow)) {
|
||||
logger.info(`window-utils: tray click, showing main window!`);
|
||||
mainWindow.show();
|
||||
}
|
||||
});
|
||||
presenceStatusStore.setCurrentTray(tray);
|
||||
return tray;
|
||||
};
|
||||
@@ -1604,7 +1619,7 @@ export const hideOrMinimizeFullscreenWindow = (window: BrowserWindow) => {
|
||||
window.hide();
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
window.minimize();
|
||||
window.hide();
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -121,6 +121,7 @@
|
||||
"Oops! Looks like we have had a crash.": "Oops! Looks like we have had a crash.",
|
||||
"Oops! Looks like we have had a crash. Please reload or close this window.": "Oops! Looks like we have had a crash. Please reload or close this window.",
|
||||
"Oops! Something went wrong. Would you like to restart the app?": "Oops! Something went wrong. Would you like to restart the app?",
|
||||
"Open Symphony Messaging": "Open Symphony Messaging",
|
||||
"Paste": "Paste",
|
||||
"Paste and Match Style": "Paste and Match Style",
|
||||
"Paste as plain text": "Paste as plain text",
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
"Oops! Looks like we have had a crash.": "Oops! Looks like we have had a crash.",
|
||||
"Oops! Looks like we have had a crash. Please reload or close this window.": "Oops! Looks like we have had a crash. Please reload or close this window.",
|
||||
"Oops! Something went wrong. Would you like to restart the app?": "Oops! Something went wrong. Would you like to restart the app?",
|
||||
"Open Symphony Messaging": "Open Symphony Messaging",
|
||||
"Paste": "Paste",
|
||||
"Paste and Match Style": "Paste and Match Style",
|
||||
"Paste as plain text": "Paste as plain text ",
|
||||
|
||||
Reference in new issue
Block a user