Skip to content

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

Open
craftablescience wants to merge 4 commits into
slaclab:masterfrom
craftablescience:pr-lxlewis-1113
Open

ENH: Add PyDMWindow widget to configure hiding the nav bar, menu bar, and status bar components on first load#1220
craftablescience wants to merge 4 commits into
slaclab:masterfrom
craftablescience:pr-lxlewis-1113

Conversation

@craftablescience

@craftablescience craftablescience commented Apr 1, 2025

Copy link
Copy Markdown
Collaborator

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

@nstelter-slac nstelter-slac left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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

@nstelter-slac nstelter-slac left a comment

Copy link
Copy Markdown
Collaborator

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

Comment thread docs/source/widgets/window.rst Outdated
Comment thread docs/source/widgets/window.rst
Comment thread docs/source/widgets/window.rst Outdated
Comment thread docs/source/widgets/window.rst
Comment thread examples/window/window.ui
@craftablescience

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator Author

Done, and rebased

@nstelter-slac nstelter-slac left a comment

Copy link
Copy Markdown
Collaborator

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