1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: zoom in/out and fullscreen shortcuts

This commit is contained in:
mladen
2025-01-14 05:24:33 +01:00
parent 34848e8dc3
commit 47ac729d2f

View File

@@ -24,6 +24,21 @@ export class ShortcutRegister {
this._menuTemplate = args.menuTemplate || {};
this._mode = args.mode;
this.shortcuts = shortcutsStore.get('shortcuts', defaultShortcuts) as ShortcutRecord[];
globalShortcut.register('CommandOrControl+=', () => {
const currentZoom = this._mainWindow.webContents.getZoomLevel();
this._mainWindow.webContents.setZoomLevel(currentZoom + 1);
});
globalShortcut.register('CommandOrControl+-', () => {
const currentZoom = this._mainWindow.webContents.getZoomLevel();
this._mainWindow.webContents.setZoomLevel(currentZoom - 1);
});
globalShortcut.register('CommandOrControl+0', () => {
this._mainWindow.webContents.setZoomLevel(0);
});
globalShortcut.register('F11', () => {
this._mainWindow.setFullScreen(!this._mainWindow.isFullScreen());
});
}
public static getInstance (args?: { mainWindow?: BrowserWindow; menuTemplate?: OsMenu; mode?: ShortcutMode }) {