refactor: revert some changes related to custom-titlebar lib

This commit is contained in:
4gray committed 2023-02-24 15:36:24 +01:00
1 parent 03ab774c54
commit 42079b4b84
1 file changed
+26
+26
View File
@@ -245,6 +245,8 @@ export class Api {
.on(EPG_FORCE_FETCH, (event, arg) =>
this.workerWindow.webContents.send(EPG_FORCE_FETCH, arg)
);
this.setTitleBarListeners();
}
/**
@@ -326,6 +328,30 @@ export class Api {
});
}
/**
* Set default listeners for custom-titlebar
*/
setTitleBarListeners() {
ipcMain.on('window-minimize', function (event) {
BrowserWindow.fromWebContents(event.sender).minimize();
});
ipcMain.on('window-maximize', function (event) {
const window = BrowserWindow.fromWebContents(event.sender);
window.isMaximized() ? window.unmaximize() : window.maximize();
});
ipcMain.on('window-close', function (event) {
BrowserWindow.fromWebContents(event.sender).close();
});
ipcMain.on('window-is-maximized', function (event) {
event.returnValue = BrowserWindow.fromWebContents(
event.sender
).isMaximized();
});
}
/**
* Fetches the playlist from the given url and triggers the update operation
* @param id id of the playlist to update