mac specific keyboard shortcuts #199

This commit is contained in:
Jan Prochazka
2022-04-09 20:00:26 +02:00
parent 5379e86d6e
commit 90f8d349fc
22 changed files with 84 additions and 56 deletions

View File

@@ -104,7 +104,7 @@
id: 'tabs.nextTab',
category: 'Tabs',
name: 'Next tab',
keyText: 'Ctrl+Tab',
keyText: 'CtrlOrCommand+Tab',
testEnabled: () => getOpenedTabs().filter(x => !x.closedTime).length >= 2,
onClick: () => {
const tabs = get(openedTabs).filter(x => x.closedTime == null);
@@ -124,7 +124,7 @@
id: 'tabs.closeTab',
category: 'Tabs',
name: 'Close tab',
keyText: isElectronAvailable() ? 'Ctrl+W' : null,
keyText: isElectronAvailable() ? 'CtrlOrCommand+W' : null,
testEnabled: () => getOpenedTabs().filter(x => !x.closedTime).length >= 1,
onClick: closeCurrentTab,
});

View File

@@ -1,7 +1,9 @@
<script context="module">
function getCommandTitle(command) {
let res = command.text;
if (command.keyText || command.keyTextFromGroup) res += ` (${command.keyText || command.keyTextFromGroup})`;
if (command.keyText || command.keyTextFromGroup) {
res += ` (${formatKeyText(command.keyText || command.keyTextFromGroup)})`;
}
return res;
}
</script>
@@ -15,6 +17,7 @@
import getElectron from '../utility/getElectron';
import { useFavorites } from '../utility/metadataLoaders';
import ToolbarButton from '../buttons/ToolbarButton.svelte';
import { formatKeyText } from '../utility/common';
const electron = getElectron();