fixed SVG icons in tab headers - fixes #5926

This commit is contained in:
Eugene Pankov
2022-03-12 18:31:21 +01:00
parent d4fb56b30b
commit 90becada86
12 changed files with 57 additions and 34 deletions

View File

@@ -40,7 +40,10 @@
)
.input-group-append
.input-group-text
i([class]='"fa-fw " + profile.icon')
profile-icon(
[icon]='profile.icon',
[color]='profile.color'
)
ng-template(#rt,let-r='result',let-t='term')
i([class]='"fa-fw " + r')

View File

@@ -58,14 +58,9 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
[class.list-group-item-action]='!profile.isBuiltin',
(click)='profile.isBuiltin ? null : editProfile(profile)'
)
i.icon(
class='fa-fw {{profile.icon}}',
[style.color]='profile.color',
*ngIf='!iconIsSVG(profile.icon)'
)
.icon(
[fastHtmlBind]='profile.icon',
*ngIf='iconIsSVG(profile.icon)'
profile-icon(
[icon]='profile.icon',
[color]='profile.color'
)
.no-wrap {{profile.name}}

View File

@@ -1,8 +1,8 @@
.icon {
profile-icon {
width: 1.25rem;
margin-right: 0.25rem;
}
.icon + * {
profile-icon + * {
margin-left: 10px;
}

View File

@@ -225,10 +225,6 @@ export class ProfilesSettingsTabComponent extends BaseComponent {
return !this.filter || (profile.name + '$' + (this.getDescription(profile) ?? '')).toLowerCase().includes(this.filter.toLowerCase())
}
iconIsSVG (icon?: string): boolean {
return icon?.startsWith('<') ?? false
}
getDescription (profile: PartialProfile<Profile>): string|null {
return this.profilesService.getDescription(profile)
}