Skip to content

Custom variable dialog improvements#38

Merged
ThomasAkam merged 7 commits intopyControl:devfrom
alustig3:custom-dialog-updates
Apr 20, 2022
Merged

Custom variable dialog improvements#38
ThomasAkam merged 7 commits intopyControl:devfrom
alustig3:custom-dialog-updates

Conversation

@alustig3
Copy link
Copy Markdown
Contributor

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_dialog variable is specified in the task, it will look in the config/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

  • You can now rearrange the tabs
  • You are now prevented from reusing tab names
  • A confirmation dialog now appears when you try to delete a tab
CleanShot.2022-04-20.at.00.50.38.mp4

@alustig3 alustig3 marked this pull request as ready for review April 20, 2022 05:22
@ThomasAkam ThomasAkam merged commit 6dc2b60 into pyControl:dev Apr 20, 2022
@ThomasAkam
Copy link
Copy Markdown
Collaborator

Thanks Andy, I've included these in the new release.

@alustig3 alustig3 deleted the custom-dialog-updates branch April 20, 2022 14:48
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
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.

2 participants