mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
Merge pull request #1269 from sbenmoussati/SDA-3381
SDA-3381 Zoom capabilities added for numpad on Windows
This commit is contained in:
commit
d3b5b2046e
@ -61,6 +61,7 @@ import {
|
|||||||
monitorNetworkInterception,
|
monitorNetworkInterception,
|
||||||
preventWindowNavigation,
|
preventWindowNavigation,
|
||||||
reloadWindow,
|
reloadWindow,
|
||||||
|
resetZoomLevel,
|
||||||
windowExists,
|
windowExists,
|
||||||
zoomIn,
|
zoomIn,
|
||||||
zoomOut,
|
zoomOut,
|
||||||
@ -1846,16 +1847,15 @@ export class WindowHandler {
|
|||||||
this.switchClient(ClientSwitchType.CLIENT_2_0_DAILY),
|
this.switchClient(ClientSwitchType.CLIENT_2_0_DAILY),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
globalShortcut.register('CmdOrCtrl+=', zoomIn);
|
||||||
|
globalShortcut.register('CmdOrCtrl+-', zoomOut);
|
||||||
if (isMac) {
|
if (isMac) {
|
||||||
globalShortcut.register('CmdOrCtrl+Plus', zoomIn);
|
globalShortcut.register('CmdOrCtrl+Plus', zoomIn);
|
||||||
globalShortcut.register('CmdOrCtrl+=', zoomIn);
|
} else if (isWindowsOS || isLinux) {
|
||||||
if (this.isMana) {
|
|
||||||
globalShortcut.register('CmdOrCtrl+-', zoomOut);
|
|
||||||
}
|
|
||||||
} else if (this.isMana && (isWindowsOS || isLinux)) {
|
|
||||||
globalShortcut.register('Ctrl+=', zoomIn);
|
globalShortcut.register('Ctrl+=', zoomIn);
|
||||||
globalShortcut.register('Ctrl+-', zoomOut);
|
globalShortcut.register('Ctrl+numadd', zoomIn);
|
||||||
|
globalShortcut.register('Ctrl+numsub', zoomOut);
|
||||||
|
globalShortcut.register('Ctrl+num0', resetZoomLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1867,15 +1867,14 @@ export class WindowHandler {
|
|||||||
|
|
||||||
globalShortcut.unregister(isMac ? 'Cmd+Alt+I' : 'Ctrl+Shift+I');
|
globalShortcut.unregister(isMac ? 'Cmd+Alt+I' : 'Ctrl+Shift+I');
|
||||||
globalShortcut.unregister('CmdOrCtrl+R');
|
globalShortcut.unregister('CmdOrCtrl+R');
|
||||||
|
globalShortcut.unregister('CmdOrCtrl+=');
|
||||||
|
globalShortcut.unregister('CmdOrCtrl+-');
|
||||||
if (isMac) {
|
if (isMac) {
|
||||||
globalShortcut.unregister('CmdOrCtrl+Plus');
|
globalShortcut.unregister('CmdOrCtrl+Plus');
|
||||||
globalShortcut.unregister('CmdOrCtrl+=');
|
} else if (isWindowsOS || isLinux) {
|
||||||
if (this.isMana) {
|
globalShortcut.unregister('Ctrl+numadd');
|
||||||
globalShortcut.unregister('CmdOrCtrl+-');
|
globalShortcut.unregister('Ctrl+numsub');
|
||||||
}
|
globalShortcut.unregister('Ctrl+num0');
|
||||||
} else if (this.isMana && (isWindowsOS || isLinux)) {
|
|
||||||
globalShortcut.unregister('Ctrl+=');
|
|
||||||
globalShortcut.unregister('Ctrl+-');
|
|
||||||
}
|
}
|
||||||
// Unregister shortcuts related to client switch
|
// Unregister shortcuts related to client switch
|
||||||
if (this.url && this.url.startsWith('https://corporate.symphony.com')) {
|
if (this.url && this.url.startsWith('https://corporate.symphony.com')) {
|
||||||
|
@ -767,8 +767,24 @@ export const zoomOut = () => {
|
|||||||
webContents.setZoomFactor(0.7);
|
webContents.setZoomFactor(0.7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
const currentZoomLevel = focusedWindow.webContents.getZoomLevel();
|
||||||
|
focusedWindow.webContents.setZoomLevel(currentZoomLevel - 0.5);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset zoom level.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export const resetZoomLevel = () => {
|
||||||
|
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
|
if (!focusedWindow || !windowExists(focusedWindow)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
focusedWindow.webContents.setZoomLevel(0);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies if window exists and restores/focuses the window
|
* Verifies if window exists and restores/focuses the window
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user