Skip to content

Commit

Permalink
feat: add context menu to terminal panes
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Oct 8, 2021
1 parent 3fce98a commit abe2c3d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions addons/settings/renderer/settings-line.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,14 @@ export default {
}
}
}
.item-label {
user-select: text;
}
.item-key {
margin-left: 16px;
font-size: 12px;
opacity: 0.5;
user-select: text;
}
.tree-node {
width: 24px;
Expand Down
23 changes: 22 additions & 1 deletion renderer/components/basic/terminal-pane.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<article class="terminal-pane">
<article class="terminal-pane" @contextmenu="openEditingMenu">
<div class="scroll-area">
<slot></slot>
</div>
Expand All @@ -8,12 +8,33 @@
</template>

<script lang="ts">
import { openContextMenu } from '../../utils/frame'
import ScrollBar from './scroll-bar.vue'
export default {
components: {
ScrollBar,
},
setup() {
function openEditingMenu(event: MouseEvent) {
openContextMenu([
{
label: 'Copy#!terminal.7',
accelerator: 'CmdOrCtrl+C',
role: 'copy',
},
{
label: 'Paste#!terminal.8',
accelerator: 'CmdOrCtrl+V',
role: 'paste',
},
], event)
}
return {
openEditingMenu,
}
},
}
</script>

Expand Down

0 comments on commit abe2c3d

Please sign in to comment.