2020-03-01 15:10:45 +00:00
|
|
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
2017-09-09 19:42:48 +00:00
|
|
|
import { Injectable } from '@angular/core'
|
2021-07-04 10:23:27 +00:00
|
|
|
import { ToolbarButtonProvider, ToolbarButton } from 'tabby-core'
|
2017-08-02 11:47:00 +00:00
|
|
|
import { TerminalService } from './services/terminal.service'
|
2017-03-24 21:24:12 +00:00
|
|
|
|
2019-03-07 01:05:26 +00:00
|
|
|
/** @hidden */
|
2017-03-24 21:24:12 +00:00
|
|
|
@Injectable()
|
2017-03-25 17:12:43 +00:00
|
|
|
export class ButtonProvider extends ToolbarButtonProvider {
|
2017-03-24 21:24:12 +00:00
|
|
|
constructor (
|
2017-08-02 11:47:00 +00:00
|
|
|
private terminal: TerminalService,
|
2017-03-24 21:24:12 +00:00
|
|
|
) {
|
2017-03-25 17:12:43 +00:00
|
|
|
super()
|
2017-03-29 12:04:01 +00:00
|
|
|
}
|
|
|
|
|
2019-06-14 21:47:48 +00:00
|
|
|
provide (): ToolbarButton[] {
|
2019-05-11 19:28:04 +00:00
|
|
|
return [
|
|
|
|
{
|
2019-06-30 21:08:30 +00:00
|
|
|
icon: require('./icons/plus.svg'),
|
2019-05-11 19:28:04 +00:00
|
|
|
title: 'New terminal',
|
|
|
|
touchBarNSImage: 'NSTouchBarAddDetailTemplate',
|
2020-04-11 10:37:46 +00:00
|
|
|
click: () => {
|
2019-05-11 19:28:04 +00:00
|
|
|
this.terminal.openTab()
|
2019-06-14 21:47:48 +00:00
|
|
|
},
|
2019-05-11 19:28:04 +00:00
|
|
|
},
|
|
|
|
]
|
2017-03-24 21:24:12 +00:00
|
|
|
}
|
|
|
|
}
|