18 lines
538 B
TypeScript
18 lines
538 B
TypeScript
import { Graphics } from 'pixi.js';
|
|
import { drawHeaderBar, HStack, Theme } from '../ui';
|
|
|
|
/** The bar across the top of a tab: its controls in a row on the header colour, a line below. */
|
|
export class TabHeader extends HStack {
|
|
private readonly bg = new Graphics();
|
|
|
|
constructor() {
|
|
super({ gap: Theme.gap, padding: Theme.padding, align: 'center' });
|
|
this.minHeight = Theme.controlHeight + Theme.padding * 2;
|
|
this.addChildAt(this.bg, 0);
|
|
}
|
|
|
|
override redraw(): void {
|
|
drawHeaderBar(this.bg, this.w, this.h);
|
|
}
|
|
}
|