|
@@ -1,5 +1,6 @@
|
|
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
|
import { Component, HostListener, Input } from '@angular/core'
|
|
import { Component, HostListener, Input } from '@angular/core'
|
|
|
|
|
+import { AppService, SplitTabComponent } from 'tabby-core'
|
|
|
import { BaseTerminalTabComponent } from '../api/baseTerminalTab.component'
|
|
import { BaseTerminalTabComponent } from '../api/baseTerminalTab.component'
|
|
|
|
|
|
|
|
/** @hidden */
|
|
/** @hidden */
|
|
@@ -11,6 +12,26 @@ import { BaseTerminalTabComponent } from '../api/baseTerminalTab.component'
|
|
|
export class TerminalToolbarComponent {
|
|
export class TerminalToolbarComponent {
|
|
|
@Input() tab: BaseTerminalTabComponent
|
|
@Input() tab: BaseTerminalTabComponent
|
|
|
|
|
|
|
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
|
|
|
+ constructor (
|
|
|
|
|
+ private app: AppService,
|
|
|
|
|
+ ) { }
|
|
|
|
|
+
|
|
|
|
|
+ onTabDragStart (): void {
|
|
|
|
|
+ this.app.emitTabDragStarted(this.tab)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ onTabDragEnd (): void {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.app.emitTabDragEnded()
|
|
|
|
|
+ this.app.emitTabsChanged()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ get shouldShowDragHandle (): boolean {
|
|
|
|
|
+ return this.tab.parent instanceof SplitTabComponent && this.tab.parent.getAllTabs().length > 1
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@HostListener('mouseenter') onMouseEnter () {
|
|
@HostListener('mouseenter') onMouseEnter () {
|
|
|
this.tab.showToolbar()
|
|
this.tab.showToolbar()
|
|
|
}
|
|
}
|