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