From 13852fe4b26c9b018ebc2f4b632a490ab34c9986 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Sep 2026 11:16:20 +0200 Subject: [PATCH] Route the widget hover cursor through the theme Button, Checkbox, the color swatch and list rows took a hard-coded 'pointer'; they now read Theme.hoverCursor, which is 'default'. Also adds the todo note for a breadcrumb when drilling into a sub-behavior in the graph. Co-Authored-By: Claude Opus 5 --- src/ui/Theme.ts | 1 + src/ui/widgets/Button.ts | 2 +- src/ui/widgets/Checkbox.ts | 2 +- src/ui/widgets/ColorField.ts | 2 +- src/ui/widgets/ListRow.ts | 2 +- todo-notes/sub-behavior-breadcrumb-navigation.md | 4 ++++ 6 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 todo-notes/sub-behavior-breadcrumb-navigation.md diff --git a/src/ui/Theme.ts b/src/ui/Theme.ts index 3d70bdbb..1b9843b9 100644 --- a/src/ui/Theme.ts +++ b/src/ui/Theme.ts @@ -18,6 +18,7 @@ export const Theme = { scrollbarWidth: 6, /** Horizontal indent per nesting level in tree lists. */ treeIndent: 14, + hoverCursor: 'default', colors: { background: 0x1b1d22, panel: 0x24272e, diff --git a/src/ui/widgets/Button.ts b/src/ui/widgets/Button.ts index acae2b73..5935c040 100644 --- a/src/ui/widgets/Button.ts +++ b/src/ui/widgets/Button.ts @@ -37,7 +37,7 @@ export class Button extends Widget { this.align = options.align ?? 'center'; this.onClick = options.onClick; this.focusable = true; - this.cursor = 'pointer'; + this.cursor = Theme.hoverCursor; this.minHeight = Theme.controlHeight; this.fixedWidth = options.width ?? 0; this.minWidth = this.fixedWidth || (options.minWidth ?? 0); diff --git a/src/ui/widgets/Checkbox.ts b/src/ui/widgets/Checkbox.ts index 5db1db4a..9594646f 100644 --- a/src/ui/widgets/Checkbox.ts +++ b/src/ui/widgets/Checkbox.ts @@ -11,7 +11,7 @@ export class Checkbox extends Widget { constructor(public checked = false) { super(); this.focusable = true; - this.cursor = 'pointer'; + this.cursor = Theme.hoverCursor; this.minWidth = Theme.controlHeight; this.minHeight = Theme.controlHeight; this.addChild(this.box); diff --git a/src/ui/widgets/ColorField.ts b/src/ui/widgets/ColorField.ts index 2cc612e7..dc0de163 100644 --- a/src/ui/widgets/ColorField.ts +++ b/src/ui/widgets/ColorField.ts @@ -101,7 +101,7 @@ export class ColorField extends Widget { class SwatchButton extends Widget { constructor(graphics: Graphics, onTap: () => void) { super(); - this.cursor = 'pointer'; + this.cursor = Theme.hoverCursor; this.minWidth = Theme.controlHeight; this.minHeight = Theme.controlHeight; this.addChild(graphics); diff --git a/src/ui/widgets/ListRow.ts b/src/ui/widgets/ListRow.ts index 7913ebd0..10ff2c87 100644 --- a/src/ui/widgets/ListRow.ts +++ b/src/ui/widgets/ListRow.ts @@ -23,7 +23,7 @@ export class ListRow extends Widget { private readonly chevronSlot: boolean, ) { super(); - this.cursor = 'pointer'; + this.cursor = Theme.hoverCursor; this.minHeight = height; if (item.overridden) this.labelText.style = textStyle('override'); this.addChild(this.bg, this.labelText, this.hint); diff --git a/todo-notes/sub-behavior-breadcrumb-navigation.md b/todo-notes/sub-behavior-breadcrumb-navigation.md new file mode 100644 index 00000000..23c6e423 --- /dev/null +++ b/todo-notes/sub-behavior-breadcrumb-navigation.md @@ -0,0 +1,4 @@ +falls man im graph ein sub-behavior klick, wäre eine breadcrumb navigation gut, sodass man auch wieder zurückspringen kann. +sobald man in der hierachie (links im panel, assets/scene objects) wieder ein neues behavior auswählt bzw. über das dropdown im graph, soll das breadcrumb wieder verschwinden. +kurz gefasst: breadcrumb anzeigen sobald behaviour in graph geöffnet wird (doppelklick). +im breadcrump selbst, beispiel: "Game > Move > Other" - hier soll man im prinzip auf "Move" oder auch "Game" klicken können. in dem beispiel wenn man auf "Game" klickt, ist man wieder "Root" d.h. breadcrumb verschwindet wieder. klickt man auf "Move" wird aus dem Breadcrumb "Game > Move"