feat: support mac swipe
Can also add up for Explore navigation in the future
This commit is contained in:
parent
b5fa7d50e5
commit
53107fa098
1 changed files with 17 additions and 4 deletions
|
@ -72,15 +72,28 @@ export default appState => {
|
||||||
}
|
}
|
||||||
|
|
||||||
setupBarMenu();
|
setupBarMenu();
|
||||||
|
// Windows back/forward mouse navigation
|
||||||
window.on('app-command', function(e, cmd) {
|
window.on('app-command', (e, cmd) => {
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case 'browser-backward':
|
case 'browser-backward':
|
||||||
window.webContents.send('navigate-backward', null);
|
window.webContents.send('navigate-backward', null);
|
||||||
return;
|
break;
|
||||||
case 'browser-forward':
|
case 'browser-forward':
|
||||||
window.webContents.send('navigate-forward', null);
|
window.webContents.send('navigate-forward', null);
|
||||||
return;
|
break;
|
||||||
|
default: // Do nothing
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Mac back/forward swipe navigation
|
||||||
|
window.on('swipe', (e, dir) => {
|
||||||
|
switch (dir) {
|
||||||
|
case 'left':
|
||||||
|
window.webContents.send('navigate-backward', null);
|
||||||
|
break;
|
||||||
|
case 'right':
|
||||||
|
window.webContents.send('navigate-forward', null);
|
||||||
|
break;
|
||||||
|
default: // Do nothing
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue