Skip to content

Commit 9e3372d

Browse files
committed
feat(core)*: introduce a dropdown menu for each panel (#8351)
This is the initial work to support the two related issues mentioned above, which is introducing the context menu for each tab panel, which will give us the place to list related actions. Relates to #8272. Relates to #8273.
1 parent 22e3396 commit 9e3372d

File tree

2 files changed

+51
-4
lines changed

2 files changed

+51
-4
lines changed

ui/src/components/MultiPanelTabs.vue

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,29 @@
5252
/>
5353
</svg>
5454
</button>
55+
56+
<el-dropdown trigger="click" placement="bottom-end">
57+
<DotsVertical class="me-2 tab-icon" />
58+
<template #dropdown>
59+
<el-dropdown-menu class="m-2">
60+
<el-dropdown-item disabled :icon="DockRight">
61+
<span class="small-text">
62+
{{ t("multi_panel_editor.move_right") }}
63+
</span>
64+
</el-dropdown-item>
65+
<el-dropdown-item disabled :icon="DockLeft">
66+
<span class="small-text">
67+
{{ t("multi_panel_editor.move_left") }}
68+
</span>
69+
</el-dropdown-item>
70+
<el-dropdown-item disabled :icon="Close">
71+
<span class="small-text">
72+
{{ t("multi_panel_editor.close_all_tabs") }}
73+
</span>
74+
</el-dropdown-item>
75+
</el-dropdown-menu>
76+
</template>
77+
</el-dropdown>
5578
</div>
5679
<div
5780
class="content-panel"
@@ -74,10 +97,19 @@
7497

7598
<script lang="ts" setup>
7699
import {nextTick, ref, watch} from "vue";
100+
import {useI18n} from "vue-i18n";
101+
77102
import "splitpanes/dist/splitpanes.css"
78103
import {Splitpanes, Pane} from "splitpanes"
104+
79105
import CloseIcon from "vue-material-design-icons/Close.vue"
80106
import CircleMediumIcon from "vue-material-design-icons/CircleMedium.vue"
107+
import DotsVertical from "vue-material-design-icons/DotsVertical.vue";
108+
import DockLeft from "vue-material-design-icons/DockLeft.vue";
109+
import DockRight from "vue-material-design-icons/DockRight.vue";
110+
import Close from "vue-material-design-icons/Close.vue";
111+
112+
const {t} = useI18n({useScope: "global"});
81113
82114
function throttle(callback: () => void, limit: number): () => void {
83115
let waiting = false;
@@ -387,6 +419,18 @@
387419
}
388420
}
389421
422+
.tab-icon{
423+
color: var(--ks-content-inactive);
424+
}
425+
426+
.small-text {
427+
font-size: .8rem;
428+
}
429+
430+
:deep(.el-dropdown-menu__item.is-disabled) {
431+
color: var(--ks-border-inactive);
432+
}
433+
390434
.editor-tabs .editor-tab{
391435
padding: 3px .5rem;
392436
border: none;
@@ -401,9 +445,7 @@
401445
gap: .5rem;
402446
color: var(--ks-content-secondary);
403447
opacity: .6;
404-
.tab-icon{
405-
color: var(--ks-content-inactive);
406-
}
448+
407449
&.active {
408450
opacity: 1;
409451
color: var(--ks-content-primary);

ui/src/translations/en.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,11 @@
12881288
}
12891289
},
12901290
"toggle_word_wrap": "Toggle Word Wrap",
1291-
"copied_logs_to_clipboard": "Copied logs to clipboard."
1291+
"copied_logs_to_clipboard": "Copied logs to clipboard.",
1292+
"multi_panel_editor": {
1293+
"move_right": "Move right",
1294+
"move_left": "Move left",
1295+
"close_all_tabs": "Close all tabs"
1296+
}
12921297
}
12931298
}

0 commit comments

Comments
 (0)