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:
@@ -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 }) {
|
||||
|
Reference in New Issue
Block a user