Custom Dockable Toolbar, without tabs.

357 views
Skip to first unread message

Kim Strandli

unread,
Jul 15, 2018, 12:43:13 PM7/15/18
to Python Programming for Autodesk Maya
Hey, all!

Is there a special trick to creating a custom dockable toolbar that behaves the same way as the StatusLine, CommandLine and those top/bottom toolbars?
It docks perfectly fine everywhere else, using either Qt or the MayaMixin method, but I wish to not have the tab visible when docked as a toolbar.

It's a small utility, which is why I'd prefer docking it next to an existing toolbar, rather than the whole bottom of the UI using DockControl

Any ideas?
-K

Auto Generated Inline Image 1

Marcus Ottosson

unread,
Jul 15, 2018, 12:52:50 PM7/15/18
to python_in...@googlegroups.com

In what way does it behave differently at the moment? It looks like it docks successfully, and that the question is about how to detect when it is horizontally docked such that you can automatically hide your inner tabs? Also docking changed somewhat in Maya 2017, which version is this question regarding?

In all versions of Maya, a dock uses the QDockWidget under the hood, maybe that has got some clues for you.

Other than that, if you are able to dock it and simply wish to discard the tabs when the widget it below a certain height, maybe you could add a resizeEvent and from there determine whether it is below that height and show/hide the tabs accordingly.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1e2bc976-7c5b-403b-a4e1-2000970a43ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kim Strandli

unread,
Jul 15, 2018, 1:40:21 PM7/15/18
to Python Programming for Autodesk Maya
When you detach the commandLine from the toolbar, and dock it underneath the outliner (as an example), it displays with a tab like default WorkspaceControl behavior. So that's consistent with what I'm getting.
The difference is, as you mention, the lack of tabs when docket to a toolbar specifically.
It also provides the dotted left-edge, which allows you to grab and detach the toolbar to be docket elsewhere. These do not show when docked outside a toolbar.

I played around with the workspaceControl attributes, but nothing made any change to this behavior.
So I assume these toolbars are built in a different way, other than being wrapped in a workspaceController.

I will investigate the QDockWidget! Thank you, Marcus :)

Marcus Ottosson

unread,
Jan 7, 2019, 1:19:43 PM1/7/19
to python_in...@googlegroups.com
Now I'm in the same boat, and looking for the magic combination of commands. :) Did you manage to solve this problem?

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/fdaf2de6-168d-43fd-8c75-96650c4b4030%40googlegroups.com.

oglop

unread,
Jan 17, 2020, 2:33:39 PM1/17/20
to Python Programming for Autodesk Maya
Here comes new passenger to the boat ! Any solutions so far ?


On Monday, January 7, 2019 at 10:19:43 AM UTC-8, Marcus Ottosson wrote:
Now I'm in the same boat, and looking for the magic combination of commands. :) Did you manage to solve this problem?

On Sun, 15 Jul 2018 at 18:40, Kim Strandli <kimst...@gmail.com> wrote:
When you detach the commandLine from the toolbar, and dock it underneath the outliner (as an example), it displays with a tab like default WorkspaceControl behavior. So that's consistent with what I'm getting.
The difference is, as you mention, the lack of tabs when docket to a toolbar specifically.
It also provides the dotted left-edge, which allows you to grab and detach the toolbar to be docket elsewhere. These do not show when docked outside a toolbar.

I played around with the workspaceControl attributes, but nothing made any change to this behavior.
So I assume these toolbars are built in a different way, other than being wrapped in a workspaceController.

I will investigate the QDockWidget! Thank you, Marcus :)



On Sunday, 15 July 2018 18:52:50 UTC+2, Marcus Ottosson wrote:

In what way does it behave differently at the moment? It looks like it docks successfully, and that the question is about how to detect when it is horizontally docked such that you can automatically hide your inner tabs? Also docking changed somewhat in Maya 2017, which version is this question regarding?

In all versions of Maya, a dock uses the QDockWidget under the hood, maybe that has got some clues for you.

Other than that, if you are able to dock it and simply wish to discard the tabs when the widget it below a certain height, maybe you could add a resizeEvent and from there determine whether it is below that height and show/hide the tabs accordingly.

On 15 July 2018 at 17:43, Kim Strandli <kimst...@gmail.com> wrote:
Hey, all!

Is there a special trick to creating a custom dockable toolbar that behaves the same way as the StatusLine, CommandLine and those top/bottom toolbars?
It docks perfectly fine everywhere else, using either Qt or the MayaMixin method, but I wish to not have the tab visible when docked as a toolbar.

It's a small utility, which is why I'd prefer docking it next to an existing toolbar, rather than the whole bottom of the UI using DockControl

Any ideas?
-K

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages