Skip to content

ENH: Add PyDMWindow widget to configure hiding the nav bar, menu bar, and status bar components on first load #1220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

craftablescience
Copy link
Collaborator

@craftablescience craftablescience commented Apr 1, 2025

Command-line parameters exist to hide these components on startup, however these aren't possible to set in Qt Designer. This PR adds the PyDMWindow widget which can replace QWidget as the root of a display widget hierarchy, and it exposes the options to hide these components on first load as checkboxes in the properties section in Designer. When a display using this widget is loaded, it will apply the requested settings if it is the first display loaded in that instance of PyDM, similar to how the command-line parameters work.

Closes #1113

Copy link
Collaborator

@nstelter-slac nstelter-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this is cool! especially with the potential to expand with more properties

also i think it would be helpful to add to /examples a simple .ui file that showcases using PyDMWindow as a base.

and could we add an .rst file for PyDMWindow to the docs?
its nice to have doc pages for the widgets have some explanation about it above the api documentation, like https://slaclab.github.io/pydm/widgets/tab_widget.html, but most lack it atm.

@craftablescience
Copy link
Collaborator Author

also i think it would be helpful to add to /examples a simple .ui file that showcases using PyDMWindow as a base.

Done

and could we add an .rst file for PyDMWindow to the docs?

Done

Copy link
Collaborator

@nstelter-slac nstelter-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried building docs (https://github.com/slaclab/pydm?tab=readme-ov-file#building-the-documentation-locally), and getting some warnings that we should address.

also getting error when trying to load example

@craftablescience
Copy link
Collaborator Author

Hopefully resolved docs errors. I'm not sure why opening the example is giving you errors, it works on my machine

@nstelter-slac
Copy link
Collaborator

ok nice, example works for me now! sry prob was just something odd on my end.

also optional to add if u want,
but i see one last build issue (but unrelated to ur changes) when building the docs:

WARNING: autodoc: failed to import class 'channel.PyDMChannel' from module 'pydm'; the following exception was raised:
No module named 'pydm.channel'

we could include the fix in the patch so building is entirely clean

_--- a/docs/source/channel.rst
+++ b/docs/source/channel.rst
@@ -2,5 +2,5 @@

-.. autoclass:: channel.PyDMChannel
+.. autoclass:: pydm.widgets.channel.PyDMChannel
:members:_

@craftablescience
Copy link
Collaborator Author

Done, and rebased

Copy link
Collaborator

@nstelter-slac nstelter-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it so you can open a pydm display with the nav bar (et al) hidden
2 participants