feat: hotkey-restart-tab, remove restart menu

This commit is contained in:
Qiming-Liu 2022-07-06 13:59:58 +09:30 committed by Eugene
parent aa5970b12d
commit c3abff56aa
6 changed files with 11 additions and 11 deletions

View File

@ -112,6 +112,10 @@ export class AppRootComponent {
if (hotkey === 'duplicate-tab') { if (hotkey === 'duplicate-tab') {
this.app.duplicateTab(this.app.activeTab) this.app.duplicateTab(this.app.activeTab)
} }
if (hotkey === 'restart-tab') {
this.app.duplicateTab(this.app.activeTab)
this.app.closeTab(this.app.activeTab, true)
}
if (hotkey === 'explode-tab' && this.app.activeTab instanceof SplitTabComponent) { if (hotkey === 'explode-tab' && this.app.activeTab instanceof SplitTabComponent) {
this.app.explodeTab(this.app.activeTab) this.app.explodeTab(this.app.activeTab)
} }

View File

@ -21,6 +21,7 @@ hotkeys:
rearrange-panes: rearrange-panes:
- 'Ctrl-Shift' - 'Ctrl-Shift'
duplicate-tab: [] duplicate-tab: []
restart-tab: []
explode-tab: explode-tab:
- 'Ctrl-Shift-.' - 'Ctrl-Shift-.'
combine-tabs: combine-tabs:

View File

@ -39,6 +39,7 @@ hotkeys:
tab-10: tab-10:
- '⌘-0' - '⌘-0'
duplicate-tab: [] duplicate-tab: []
restart-tab: []
explode-tab: explode-tab:
- '⌘-Shift-.' - '⌘-Shift-.'
combine-tabs: combine-tabs:

View File

@ -22,6 +22,7 @@ hotkeys:
rearrange-panes: rearrange-panes:
- 'Ctrl-Shift' - 'Ctrl-Shift'
duplicate-tab: [] duplicate-tab: []
restart-tab: []
explode-tab: explode-tab:
- 'Ctrl-Shift-.' - 'Ctrl-Shift-.'
combine-tabs: combine-tabs:

View File

@ -56,6 +56,10 @@ export class AppHotkeyProvider extends HotkeyProvider {
id: 'duplicate-tab', id: 'duplicate-tab',
name: this.translate.instant('Duplicate tab'), name: this.translate.instant('Duplicate tab'),
}, },
{
id: 'restart-tab',
name: this.translate.instant('Restart tab'),
},
{ {
id: 'explode-tab', id: 'explode-tab',
name: this.translate.instant('Turn current tab\'s panes into separate tabs'), name: this.translate.instant('Turn current tab\'s panes into separate tabs'),

View File

@ -120,17 +120,6 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider {
label: this.translate.instant('Duplicate'), label: this.translate.instant('Duplicate'),
click: () => this.app.duplicateTab(tab), click: () => this.app.duplicateTab(tab),
}, },
{
label: this.translate.instant('Restart'),
click: () => {
this.app.duplicateTab(tab)
if (this.app.tabs.includes(tab)) {
this.app.closeTab(tab, true)
} else {
tab.destroy()
}
},
},
{ {
label: this.translate.instant('Color'), label: this.translate.instant('Color'),
sublabel: currentColor ? this.translate.instant(currentColor) : undefined, sublabel: currentColor ? this.translate.instant(currentColor) : undefined,