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 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f92a06c84
commit
13852fe4b2
6 files changed
+9
-4
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user