mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-28 09:51:06 -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,
|
||||
preventWindowNavigation,
|
||||
reloadWindow,
|
||||
resetZoomLevel,
|
||||
windowExists,
|
||||
zoomIn,
|
||||
zoomOut,
|
||||
@ -1846,16 +1847,15 @@ export class WindowHandler {
|
||||
this.switchClient(ClientSwitchType.CLIENT_2_0_DAILY),
|
||||
);
|
||||
}
|
||||
|
||||
globalShortcut.register('CmdOrCtrl+=', zoomIn);
|
||||
globalShortcut.register('CmdOrCtrl+-', zoomOut);
|
||||
if (isMac) {
|
||||
globalShortcut.register('CmdOrCtrl+Plus', zoomIn);
|
||||
globalShortcut.register('CmdOrCtrl+=', zoomIn);
|
||||
if (this.isMana) {
|
||||
globalShortcut.register('CmdOrCtrl+-', zoomOut);
|
||||
}
|
||||
} else if (this.isMana && (isWindowsOS || isLinux)) {
|
||||
} else if (isWindowsOS || isLinux) {
|
||||
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('CmdOrCtrl+R');
|
||||
globalShortcut.unregister('CmdOrCtrl+=');
|
||||
globalShortcut.unregister('CmdOrCtrl+-');
|
||||
if (isMac) {
|
||||
globalShortcut.unregister('CmdOrCtrl+Plus');
|
||||
globalShortcut.unregister('CmdOrCtrl+=');
|
||||
if (this.isMana) {
|
||||
globalShortcut.unregister('CmdOrCtrl+-');
|
||||
}
|
||||
} else if (this.isMana && (isWindowsOS || isLinux)) {
|
||||
globalShortcut.unregister('Ctrl+=');
|
||||
globalShortcut.unregister('Ctrl+-');
|
||||
} else if (isWindowsOS || isLinux) {
|
||||
globalShortcut.unregister('Ctrl+numadd');
|
||||
globalShortcut.unregister('Ctrl+numsub');
|
||||
globalShortcut.unregister('Ctrl+num0');
|
||||
}
|
||||
// Unregister shortcuts related to client switch
|
||||
if (this.url && this.url.startsWith('https://corporate.symphony.com')) {
|
||||
|
@ -767,8 +767,24 @@ export const zoomOut = () => {
|
||||
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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user