mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-04 18:39:54 +00:00
Add Hide Tab Index and Hide Tab Close Button
This commit is contained in:
parent
bc5e6e9535
commit
299ede2eb1
@ -45,6 +45,8 @@ export abstract class BaseTabComponent {
|
|||||||
color: string|null = null
|
color: string|null = null
|
||||||
|
|
||||||
hasFocus = false
|
hasFocus = false
|
||||||
|
showIndex = true
|
||||||
|
showCloseButton = true
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ping this if your recovery state has been changed and you want
|
* Ping this if your recovery state has been changed and you want
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
.progressbar([style.width]='progress + "%"', *ngIf='progress != null')
|
.progressbar([style.width]='progress + "%"', *ngIf='progress != null')
|
||||||
.index(
|
.index(*ngIf='tab.showIndex==true',
|
||||||
#handle,
|
#handle,
|
||||||
[style.background-color]='tab.color',
|
[style.background-color]='tab.color',
|
||||||
) {{index + 1}}
|
) {{index + 1}}
|
||||||
.name([title]='tab.customTitle || tab.title') {{tab.customTitle || tab.title}}
|
.name([title]='tab.customTitle || tab.title') {{tab.customTitle || tab.title}}
|
||||||
button((click)='app.closeTab(tab, true)') ×
|
button(*ngIf='tab.showCloseButton==true',(click)='app.closeTab(tab, true)') ×
|
||||||
|
@ -9,6 +9,7 @@ import { HotkeysService } from '../services/hotkeys.service'
|
|||||||
import { ElectronService } from '../services/electron.service'
|
import { ElectronService } from '../services/electron.service'
|
||||||
import { AppService } from '../services/app.service'
|
import { AppService } from '../services/app.service'
|
||||||
import { HostAppService, Platform } from '../services/hostApp.service'
|
import { HostAppService, Platform } from '../services/hostApp.service'
|
||||||
|
import { ConfigService } from '../services/config.service'
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
export interface SortableComponentProxy {
|
export interface SortableComponentProxy {
|
||||||
@ -35,6 +36,7 @@ export class TabHeaderComponent {
|
|||||||
private hostApp: HostAppService,
|
private hostApp: HostAppService,
|
||||||
private ngbModal: NgbModal,
|
private ngbModal: NgbModal,
|
||||||
private hotkeys: HotkeysService,
|
private hotkeys: HotkeysService,
|
||||||
|
private config: ConfigService,
|
||||||
@Inject(SortableComponent) private parentDraggable: SortableComponentProxy,
|
@Inject(SortableComponent) private parentDraggable: SortableComponentProxy,
|
||||||
@Optional() @Inject(TabContextMenuItemProvider) protected contextMenuProviders: TabContextMenuItemProvider[],
|
@Optional() @Inject(TabContextMenuItemProvider) protected contextMenuProviders: TabContextMenuItemProvider[],
|
||||||
) {
|
) {
|
||||||
@ -52,6 +54,15 @@ export class TabHeaderComponent {
|
|||||||
this.tab.progress$.subscribe(progress => {
|
this.tab.progress$.subscribe(progress => {
|
||||||
this.progress = progress
|
this.progress = progress
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (this.config.store.terminal.disableTabIndex) {
|
||||||
|
this.tab.showIndex = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.config.store.terminal.disableCloseButton) {
|
||||||
|
this.tab.showCloseButton = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit () {
|
ngAfterViewInit () {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --color",
|
"build": "webpack --progress --color",
|
||||||
"watch": "webpack --progress --color --watch",
|
"watch": "webpack --progress --color --watch",
|
||||||
"postinstall": "xcopy /i node_modules\\ssh2\\util\\pagent.exe util\\"
|
"postinstall:win32": "xcopy /i node_modules\\ssh2\\util\\pagent.exe util\\"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
|
@ -109,6 +109,24 @@ h3.mb-3 Appearance
|
|||||||
(ngModelChange)='config.save()',
|
(ngModelChange)='config.save()',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
.form-line
|
||||||
|
.header
|
||||||
|
.title Disable Tab Index
|
||||||
|
|
||||||
|
toggle(
|
||||||
|
[(ngModel)]='config.store.terminal.disableTabIndex',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
|
||||||
|
.form-line
|
||||||
|
.header
|
||||||
|
.title Disable Tab Close Button
|
||||||
|
|
||||||
|
toggle(
|
||||||
|
[(ngModel)]='config.store.terminal.disableCloseButton',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
|
||||||
.form-line
|
.form-line
|
||||||
.header
|
.header
|
||||||
.title Fallback font
|
.title Fallback font
|
||||||
|
@ -23,6 +23,8 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||||||
ligatures: false,
|
ligatures: false,
|
||||||
cursor: 'block',
|
cursor: 'block',
|
||||||
cursorBlink: true,
|
cursorBlink: true,
|
||||||
|
disableTabIndex: false,
|
||||||
|
disableCloseButton: false,
|
||||||
customShell: '',
|
customShell: '',
|
||||||
rightClick: 'menu',
|
rightClick: 'menu',
|
||||||
pasteOnMiddleClick: true,
|
pasteOnMiddleClick: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user