Skip to content

Commit 21e66f5

Browse files
committed
fix powerline tabs - use proper SVG chevrons
1 parent a2ba42c commit 21e66f5

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

src/components/live-preview/terminal-window.component.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,17 @@ import { FontPresetsService } from '../../services/font-presets.service';
109109
}
110110
@case ('powerline') {
111111
@for (tab of tabs; track tab.name; let i = $index) {
112-
<div class="relative px-4 py-1.5 text-xs whitespace-nowrap flex items-center powerline-tab" [ngStyle]="powerlineTabStyles(i === 0)">{{ tab.name }}</div>
112+
<div class="flex items-center">
113+
<div class="px-3 py-1.5 text-xs whitespace-nowrap flex items-center" [ngStyle]="simpleTabStyles(i === 0)">
114+
{{ tab.name }}
115+
</div>
116+
@if (i < tabs.length - 1) {
117+
<svg width="14" height="24" viewBox="0 0 14 24" preserveAspectRatio="none" class="flex-shrink-0">
118+
<path d="M0,0 L14,12 L0,24 Z" [attr.fill]="tabBgColor(i === 0)"/>
119+
<path d="M0,0 L14,12 L0,24 L14,24 L14,0 Z" [attr.fill]="tabBgColor(false)"/>
120+
</svg>
121+
}
122+
</div>
113123
}
114124
<div class="flex-1" [style.background]="tabBarBg()"></div>
115125
}
@@ -129,8 +139,6 @@ import { FontPresetsService } from '../../services/font-presets.service';
129139
.animate-blink { animation: blink 1s step-end infinite; }
130140
.slanted-tab { clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%); padding-left: 16px; padding-right: 16px; margin-right: -4px; }
131141
.slanted-tab:first-child { clip-path: polygon(0% 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%); padding-left: 12px; }
132-
.powerline-tab { clip-path: polygon(0% 0%, calc(100% - 10px) 0%, 100% 50%, calc(100% - 10px) 100%, 0% 100%, 10px 50%); padding-left: 20px; padding-right: 14px; margin-left: -10px; }
133-
.powerline-tab:first-child { clip-path: polygon(0% 0%, calc(100% - 10px) 0%, 100% 50%, calc(100% - 10px) 100%, 0% 100%); padding-left: 12px; margin-left: 0; }
134142
`]
135143
})
136144
export class TerminalWindowComponent {
@@ -209,6 +217,11 @@ export class TerminalWindowComponent {
209217
return { background: bg, color: isActive ? cfg.active_tab_foreground : cfg.inactive_tab_foreground, fontWeight: isActive ? '600' : '400', '--tab-bg': bg } as Record<string, string>;
210218
}
211219

220+
tabBgColor(isActive: boolean): string {
221+
const cfg = this.tabBarCfg();
222+
return isActive ? cfg.active_tab_background : cfg.inactive_tab_background;
223+
}
224+
212225
cursorShape = computed(() => this.cursorCfg().cursor_shape);
213226
cursorColor = computed(() => { const c = this.cursorCfg().cursor; return c === 'none' || !c?.startsWith('#') ? this.colors().foreground : c; });
214227
cursorTextColor = computed(() => { const c = this.cursorCfg().cursor_text_color; return c === 'background' ? this.colors().background : (c?.startsWith('#') ? c : this.colors().background); });

0 commit comments

Comments
 (0)