mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-20 11:29:56 +00:00
fixed the color and title settings not getting inherited from profile defaults - fixes #5395
This commit is contained in:
parent
6289229bf2
commit
eb0fa29fad
@ -47,7 +47,9 @@ export abstract class BaseTabComponent extends BaseComponent {
|
||||
/**
|
||||
* CSS color override for the tab's header
|
||||
*/
|
||||
color: string|null = null
|
||||
get color (): string|null { return this._color }
|
||||
set color (value: string|null) { this._color = value }
|
||||
private _color: string|null = null
|
||||
|
||||
hasFocus = false
|
||||
|
||||
|
@ -629,6 +629,16 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
|
||||
super.clearActivity()
|
||||
}
|
||||
|
||||
get color (): string|null {
|
||||
return this.getFocusedTab()?.color ?? null
|
||||
}
|
||||
|
||||
set color (color: string|null) {
|
||||
for (const t of this.getAllTabs()) {
|
||||
t.color = color
|
||||
}
|
||||
}
|
||||
|
||||
private updateTitle (): void {
|
||||
this.setTitle(this.getAllTabs().map(x => x.title).join(' | '))
|
||||
}
|
||||
|
@ -37,9 +37,7 @@ export class ProfilesService {
|
||||
async openNewTabForProfile <P extends Profile> (profile: PartialProfile<P>): Promise<BaseTabComponent|null> {
|
||||
const params = await this.newTabParametersForProfile(profile)
|
||||
if (params) {
|
||||
const tab = this.app.openNewTab(params)
|
||||
;(this.app.getParentTab(tab) ?? tab).color = profile.color ?? null
|
||||
return tab
|
||||
return this.app.openNewTab(params)
|
||||
}
|
||||
return null
|
||||
}
|
||||
@ -50,9 +48,12 @@ export class ProfilesService {
|
||||
if (params) {
|
||||
params.inputs ??= {}
|
||||
params.inputs['title'] = profile.name
|
||||
if (profile.disableDynamicTitle) {
|
||||
if (fullProfile.disableDynamicTitle) {
|
||||
params.inputs['disableDynamicTitle'] = true
|
||||
}
|
||||
if (fullProfile.color) {
|
||||
params.inputs['color'] = fullProfile.color
|
||||
}
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user