From 81663f351a170bdf6c310acfaf83028347103886 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sat, 14 Aug 2021 23:14:14 +0200 Subject: [PATCH] show icon colors in profile selector - fixes #4405 --- tabby-core/src/api/selector.ts | 1 + tabby-core/src/components/selectorModal.component.pug | 4 +++- tabby-core/src/services/profiles.service.ts | 4 +++- tabby-core/src/theme.scss | 2 +- tabby-core/src/theme.vars.scss | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tabby-core/src/api/selector.ts b/tabby-core/src/api/selector.ts index 3118dfea..c8437721 100644 --- a/tabby-core/src/api/selector.ts +++ b/tabby-core/src/api/selector.ts @@ -4,5 +4,6 @@ export interface SelectorOption { result?: T icon?: string freeInputPattern?: string + color?: string callback?: (string?) => void } diff --git a/tabby-core/src/components/selectorModal.component.pug b/tabby-core/src/components/selectorModal.component.pug index ea1a1c92..9c0064f9 100644 --- a/tabby-core/src/components/selectorModal.component.pug +++ b/tabby-core/src/components/selectorModal.component.pug @@ -7,7 +7,7 @@ (ngModelChange)='onFilterChange()' ) - .list-group(*ngIf='filteredOptions.length') + div(*ngIf='filteredOptions.length') a.list-group-item.list-group-item-action.d-flex.align-items-center( #item, (click)='selectOption(option)', @@ -16,10 +16,12 @@ ) i.icon( class='fa-fw {{option.icon}}', + style='color: {{option.color}}', *ngIf='!iconIsSVG(option.icon)' ) .icon( [fastHtmlBind]='option.icon', + style='color: {{option.color}}', *ngIf='iconIsSVG(option.icon)' ) .title.mr-2 {{getOptionText(option)}} diff --git a/tabby-core/src/services/profiles.service.ts b/tabby-core/src/services/profiles.service.ts index f06ee33e..7d2ada78 100644 --- a/tabby-core/src/services/profiles.service.ts +++ b/tabby-core/src/services/profiles.service.ts @@ -84,8 +84,9 @@ export class ProfilesService { selectorOptionForProfile

(profile: PartialProfile

): SelectorOption { const fullProfile = this.getConfigProxyForProfile(profile) return { - icon: profile.icon, name: profile.group ? `${fullProfile.group} / ${fullProfile.name}` : fullProfile.name, + icon: profile.icon, + color: profile.color, description: this.providerForProfile(fullProfile)?.getDescription(fullProfile), } } @@ -99,6 +100,7 @@ export class ProfilesService { let options: SelectorOption[] = recentProfiles.map(p => ({ ...this.selectorOptionForProfile(p), icon: 'fas fa-history', + color: p.color, callback: async () => { if (p.id) { p = (await this.getProfiles()).find(x => x.id === p.id) ?? p diff --git a/tabby-core/src/theme.scss b/tabby-core/src/theme.scss index 96328608..a7630e29 100644 --- a/tabby-core/src/theme.scss +++ b/tabby-core/src/theme.scss @@ -230,7 +230,7 @@ hotkey-input-modal { } } -.list-group.list-group-flush .list-group-item:not(.list-group-item-action) { +.list-group.list-group-flush { background: transparent; border-color: rgba(0, 0, 0, 0.2); diff --git a/tabby-core/src/theme.vars.scss b/tabby-core/src/theme.vars.scss index 32ba0149..4d7cb7ae 100644 --- a/tabby-core/src/theme.vars.scss +++ b/tabby-core/src/theme.vars.scss @@ -88,7 +88,7 @@ $list-group-item-padding-y: 0.8rem; $list-group-item-padding-x: 1rem; $list-group-hover-bg: $table-bg-hover; -$list-group-active-bg: rgba(255,255,255,.2); +$list-group-active-bg: rgba(255,255,255,.05); $list-group-active-color: $component-active-color; $list-group-active-border-color: translate; -- GitLab