Replies: 1 comment
-
|
Per-widget style customization (like button.background = ...) isn’t supported. Button widgets are rendered on a canvas, and their background color is controlled by a getter that returns a global constant, not a per-widget property. This means you can’t change the style of an individual button after creation, and CSS or DOM styling won’t work since these aren’t DOM elements—they’re drawn directly to the canvas. If you want to change the style, your options are to override the global LiteGraph constants (which affects all widgets), extend or replace the widget implementation, or create a fully custom widget with its own draw routine. There’s an open feature request to make widget theming more flexible, but it’s not implemented yet (source). If you want to pursue advanced customization, you’d need to subclass the widget and override its drawWidget method to use your own colors (ButtonWidget code reference). To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When creating a button widget using
const button = node.addWidget(...), is there a way to change the button’s background color—something likebutton.background = ...?More generally, is it possible to access and modify the widget’s style properties?
Beta Was this translation helpful? Give feedback.
All reactions