Set fixed / max width for a workspace control?

AronDurkin
Enthusiast
Enthusiast

Set fixed / max width for a workspace control?

AronDurkin
Enthusiast
Enthusiast

Feel like I'm losing my mind trying to do this, it seems "widthProperty" doesnt really do anything on workspaceControl?

I've got this control, either floating or docked, I wanna limit it's width to 200, or fix it at 200, and I can't for the life of me figure out how.

 

https://imgur.com/YODdHYz

Reply
476 Views
1 Reply
Reply (1)

ninhenzo64
Contributor
Contributor

yes - i have the same problem. there's a bug with MayaQWidgetDockableMixin where it randomly can't be resized to be smaller. if you make it larger, the contents get larger but then you're stuck with the control that size - you can't make it narrower even by deleting the workspace control and rebuilding it. the only fix is to restart maya.

 

one hack is to resize the contents programmatically and then manually resize the workspace control to make it as narrow as the contents. but none of the flags in cmds.workspaceControl seem to work to allow this to be automated - i tried width, initialWidth, resizeWidth.

 

i think that MayaQWidgetDockableMixin in maya.app.general.mayaMixin is just super buggy. so annoying that there's no way to dock nicely any more! i think they broke that in 2012 - back then you could just use a simple QDockWidget.

0 Likes