Custom variable dialog improvements#38
Merged
ThomasAkam merged 7 commits intopyControl:devfrom Apr 20, 2022
Merged
Conversation
…le change - can now shift a tab left or right - added confirmation dialog when removing a tab - added warning and won't allow a tab title to be set to an existing tab title
Collaborator
|
Thanks Andy, I've included these in the new release. |
IsabelDAlessandro
pushed a commit
to IsabelDAlessandro/pycontrol_code
that referenced
this pull request
Jan 21, 2026
* make add button like others * fixed bug where "add" button was crashing pyControl * Now possible to use pyqt dialog class from .py file if .json doesn’t exist * fixed alignment issues * make custom variable dialog scrollable * can rearrange tabs. added checks/warnings for tab removal and tab title change - can now shift a tab left or right - added confirmation dialog when removing a tab - added warning and won't allow a tab title to be set to an existing tab title * added .py custom gui example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are some improvements to the custom variable dialog. The bugfix from #37 is included, but I have made this a separate pull request in case you wanted to spend time reviewing these changes but didn't want to hold up the bugfix from being merged/released.
custom GUI from .py file
I've added the ability to load the custom dialog from a .py as discussed previously #23 (comment). If a
v.custom_variables_dialogvariable is specified in the task, it will look in theconfig/user_variable_dialogs/folder for a .json file first and if not found, then look for a .py file. I tried to cover a wide variety of custom GUI elements in the example, including: labels with custom css, an image, a movie, buttons that alter the slider value, and radio buttons that modify task variables as well as enable/disable the count controls (see below)CleanShot.2022-04-20.at.01.08.45.mp4
dialog size and alignment
The dialog window would expand to fit the list of controls. This could be undesirable for tasks that had a long list of variables/controls. Another problem was that if one tab had fewer controls than another, the controls would be spaced out in the excessively large window (see below)
CleanShot.2022-04-20.at.00.29.30.mp4
to fix these problems, the dialog now has a scrollbar and controls are aligned to the top of the tab (see below)
CleanShot.2022-04-20.at.00.40.29.mp4
editor improvements
CleanShot.2022-04-20.at.00.50.38.mp4