mirror of
https://github.com/A-Star100/simpliplay-desktop.git
synced 2025-09-17 22:29:38 +00:00
Update main.js
This commit is contained in:
parent
c173ffcc97
commit
8e05ff94dd
@ -132,20 +132,21 @@ const setupMenu = () => {
|
||||
Menu.setApplicationMenu(menu);
|
||||
};
|
||||
|
||||
// Quit Confirmation on CommandOrControl+Q
|
||||
const setupShortcuts = () => {
|
||||
globalShortcut.register('CommandOrControl+Q', () => {
|
||||
if (mainWindow) {
|
||||
dialog.showMessageBox(mainWindow, {
|
||||
type: 'question',
|
||||
buttons: ['Cancel', 'Quit'],
|
||||
defaultId: 1,
|
||||
title: 'Quit?',
|
||||
message: 'Are you sure you want to quit SimpliPlay?',
|
||||
}).then(({ response }) => {
|
||||
if (response === 1) app.quit();
|
||||
});
|
||||
}
|
||||
const focusedWindow = BrowserWindow.getFocusedWindow(); // Get the currently focused window
|
||||
|
||||
if (!focusedWindow) return; // Do nothing if no window is focused
|
||||
|
||||
dialog.showMessageBox(focusedWindow, {
|
||||
type: 'question',
|
||||
buttons: ['Cancel', 'Quit'],
|
||||
defaultId: 1,
|
||||
title: 'Quit?',
|
||||
message: 'Are you sure you want to quit SimpliPlay?',
|
||||
}).then(({ response }) => {
|
||||
if (response === 1) app.quit();
|
||||
});
|
||||
});
|
||||
|
||||
globalShortcut.register('CommandOrControl+Shift+S', takeSnapshot);
|
||||
|
Loading…
Reference in New Issue
Block a user