mirror of
https://github.com/Eugeny/tabby
synced 2024-11-15 01:17:14 +00:00
optional profile icon added to tabHeader
This commit is contained in:
parent
0180fb0134
commit
0eb1e8117c
9 changed files with 39 additions and 1 deletions
|
@ -4,6 +4,7 @@ import { NewTabParameters } from '../services/tabs.service'
|
|||
export interface RecoveryToken {
|
||||
[_: string]: any
|
||||
type: string
|
||||
tabIcon?: string|null
|
||||
tabColor?: string|null
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,13 @@ export abstract class BaseTabComponent extends BaseComponent {
|
|||
set color (value: string|null) { this._color = value }
|
||||
private _color: string|null = null
|
||||
|
||||
/**
|
||||
* icon override for the tab's header
|
||||
*/
|
||||
get icon (): string|null { return this._icon }
|
||||
set icon (value: string|null) { this._icon = value }
|
||||
private _icon: string|null = null
|
||||
|
||||
hasFocus = false
|
||||
|
||||
/**
|
||||
|
|
|
@ -624,6 +624,16 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
|
|||
super.clearActivity()
|
||||
}
|
||||
|
||||
get icon (): string|null {
|
||||
return this.getFocusedTab()?.icon ?? null
|
||||
}
|
||||
|
||||
set icon (icon: string|null) {
|
||||
for (const t of this.getAllTabs()) {
|
||||
t.icon = icon
|
||||
}
|
||||
}
|
||||
|
||||
get color (): string|null {
|
||||
return this.getFocusedTab()?.color ?? null
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
.index(*ngIf='!config.store.terminal.hideTabIndex && hostApp.platform === Platform.macOS', cdkDragHandle) {{index + 1}}
|
||||
.index(*ngIf='!config.store.terminal.hideTabIndex && hostApp.platform !== Platform.macOS') {{index + 1}}
|
||||
|
||||
.icon(class='fa-fw {{tab.icon}}', style='{{ (tab.color)?"color:"+tab.color:"" }}', *ngIf='config.store.terminal.showTabProfileIcon')
|
||||
|
||||
.name(
|
||||
[title]='tab.customTitle || tab.title',
|
||||
[class.no-hover]='config.store.terminal.hideCloseButton'
|
||||
|
|
|
@ -26,7 +26,8 @@ $tabs-height: 38px;
|
|||
height: $tabs-height;
|
||||
}
|
||||
|
||||
.index {
|
||||
.index,
|
||||
.icon {
|
||||
flex: none;
|
||||
font-weight: bold;
|
||||
-webkit-app-region: no-drag;
|
||||
|
|
|
@ -54,6 +54,9 @@ export class ProfilesService {
|
|||
if (fullProfile.color) {
|
||||
params.inputs['color'] = fullProfile.color
|
||||
}
|
||||
if (fullProfile.icon) {
|
||||
params.inputs['icon'] = fullProfile.icon
|
||||
}
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
|
|
@ -35,6 +35,9 @@ export class TabRecoveryService {
|
|||
if (token) {
|
||||
token.tabTitle = tab.title
|
||||
token.tabCustomTitle = tab.customTitle
|
||||
if (tab.icon) {
|
||||
token.tabIcon = tab.icon
|
||||
}
|
||||
if (tab.color) {
|
||||
token.tabColor = tab.color
|
||||
}
|
||||
|
@ -51,6 +54,7 @@ export class TabRecoveryService {
|
|||
}
|
||||
const tab = await provider.recover(token)
|
||||
tab.inputs = tab.inputs ?? {}
|
||||
tab.inputs.icon = token.tabIcon ?? null
|
||||
tab.inputs.color = token.tabColor ?? null
|
||||
tab.inputs.title = token.tabTitle || ''
|
||||
tab.inputs.customTitle = token.tabCustomTitle || ''
|
||||
|
|
|
@ -286,6 +286,15 @@ h3.mt-4(translate) Tabs
|
|||
(ngModelChange)='config.save();',
|
||||
)
|
||||
|
||||
.form-line
|
||||
.header
|
||||
.title(translate) Show profile icon on tab
|
||||
|
||||
toggle(
|
||||
[(ngModel)]='config.store.terminal.showTabProfileIcon',
|
||||
(ngModelChange)='config.save();',
|
||||
)
|
||||
|
||||
.form-line
|
||||
.header
|
||||
.title(translate) Hide tab close button
|
||||
|
|
|
@ -19,6 +19,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||
cursor: 'block',
|
||||
cursorBlink: true,
|
||||
hideTabIndex: false,
|
||||
showTabProfileIcon: false,
|
||||
hideCloseButton: false,
|
||||
rightClick: 'menu',
|
||||
pasteOnMiddleClick: true,
|
||||
|
|
Loading…
Reference in a new issue