save split button

This commit is contained in:
Jan Prochazka
2022-02-17 12:15:27 +01:00
parent 6a7afeff53
commit 1a4decd962
7 changed files with 63 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
<script lang="ts">
import getElectron from '../utility/getElectron';
import ToolStripCommandButton from './ToolStripCommandButton.svelte';
import ToolStripSplitDropDownButton from './ToolStripSplitDropDownButton.svelte';
export let idPrefix;
const electron = getElectron();
</script>
<ToolStripCommandButton
command={`${idPrefix}.save`}
component={ToolStripSplitDropDownButton}
menu={[
{ command: `${idPrefix}.save` },
{ command: `${idPrefix}.saveAs` },
electron && { command: `${idPrefix}.saveToDisk` },
]}
/>