Cannot change default cursor or ResliceCursorWidget


I try to change the default cursor of my instance of ResliceCursorWidget like in the example:

	translateCenter: 'hand', // this works
	default: 'move' // does not work

I found that the WidgetManager over writes this in line 153 when no widget is selected:

// Default cursor behavior
model._apiSpecificRenderWindow.setCursor(widget ? 'pointer' : 'default');

How can i change this behaviour of the WidgetManager?

Thank you,

I guess WidgetManager could expose a setCursorStyles public function.
WDYT @Forrest ?

I think we can let the widget manager support configuring that setCursor call. Something like widgetManager.setCursorStyles({ hover: 'pointer', default: 'default' }) could do the trick, and provides a point of extension in case we need more than just “hover” and “default” in the future.

That being said, having a “default” cursor on the widget itself requires understanding when that “default” style is applied. In the reslice cursor widget’s case, it roughly means “set the cursor to ‘default’ when the widget interaction state does not have an associated cursor style and when interacting with the widget.” It doesn’t mean “set the cursor style when not interacting with the widget.”

This is now available with the latest version of vtk.js: feat(WidgetManager): customize cursor styles by floryst · Pull Request #3045 · Kitware/vtk-js · GitHub

widgetManager.setCursorStyles(...) works fine.
Thank you for that change :grinning: