diff --git a/src/editor/texture/TextureCanvas.ts b/src/editor/texture/TextureCanvas.ts index 28cd9d97..25de8ae0 100644 --- a/src/editor/texture/TextureCanvas.ts +++ b/src/editor/texture/TextureCanvas.ts @@ -436,13 +436,12 @@ export class TextureCanvas extends Widget { return; } if (!label) { - label = new Text({ style: textStyle('body') }); + label = new Text({ style: textStyle('viewportLabel') }); this.labels.set(frame.id, label); this.labelLayer.addChild(label); } label.visible = true; if (label.text !== frame.name) label.text = frame.name; - label.style.fill = Theme.colors.text; const x = at.x + LABEL_INSET; const y = at.y + LABEL_INSET; label.position.set(x + LABEL_PAD, y + LABEL_PAD); diff --git a/src/ui/Theme.ts b/src/ui/Theme.ts index be0e002a..8be08cbc 100644 --- a/src/ui/Theme.ts +++ b/src/ui/Theme.ts @@ -6,6 +6,7 @@ export const Theme = { monoFont: '"JetBrains Mono", Consolas, "Courier New", monospace', fontSize: 13, smallFontSize: 11, + viewportLabelSize: 10, rowHeight: 26, controlHeight: 24, padding: 8, @@ -62,7 +63,16 @@ export const Theme = { const styleCache = new Map(); -export type TextStyleToken = 'body' | 'bodyBold' | 'muted' | 'small' | 'title' | 'mono' | 'accent'; +export type TextStyleToken = + | 'body' + | 'bodyBold' + | 'muted' + | 'small' + | 'title' + | 'mono' + | 'accent' + | 'viewportLabel' + | 'viewportLabelMuted'; /** Shared TextStyle instances so Pixi can cache glyph measurements per token. */ export function textStyle(token: TextStyleToken = 'body'): TextStyle { @@ -97,6 +107,12 @@ export function textStyle(token: TextStyleToken = 'body'): TextStyle { case 'accent': style = new TextStyle({ ...base, fill: Theme.colors.accentText, fontWeight: '600' }); break; + case 'viewportLabel': + style = new TextStyle({ ...base, fontSize: Theme.viewportLabelSize }); + break; + case 'viewportLabelMuted': + style = new TextStyle({ ...base, fontSize: Theme.viewportLabelSize, fill: Theme.colors.textMuted }); + break; } styleCache.set(token, style); return style; diff --git a/src/viewport/SceneViewport.ts b/src/viewport/SceneViewport.ts index 330e3aef..4623de40 100644 --- a/src/viewport/SceneViewport.ts +++ b/src/viewport/SceneViewport.ts @@ -294,7 +294,7 @@ export class SceneViewport extends WorldViewport { return; } if (!label) { - label = new Text({ text: '', style: textStyle('small') }); + label = new Text({ text: '', style: textStyle('viewportLabelMuted') }); label.eventMode = 'none'; this.labels.set(item.id, label); this.overlay.addChild(label);