fix: Global GUI stylesheet and wrap app execution in main() - #221
fix: Global GUI stylesheet and wrap app execution in main()#221q24609962-svg wants to merge 13 commits into
Conversation
Global GUI stylesheet: I updated src/GUI/code/main.py to enforce clear, readable colors across all GUI windows (including CV/CA/LSV creators, experiment list, and port dropdown). Key addition (already in your file now): app = QApplication(sys.argv)
|
Thanks for this @q24609962-svg Since we can't write tests for this, please could you post images of the gui in light and dark mode on the different platforms to make sure it is a global fix? If you don't have access to all the platforms let's ask if there are other users who can check that. |
Created a new app_setup.py file to centralize the creation of the QApplication and enforce a consistent stylesheet for readable text and background colors. Updated main.py to utilize this new function, streamlining the application setup process. Added a test for the stylesheet to ensure it sets readable colors across GUI components.
Updated the test file to skip tests if PySide6 is not available, ensuring compatibility and preventing import errors. This change enhances the robustness of the test suite when running in environments without PySide6.
|
Sorry I don't have access to all platforms, it will be good for other users to check |
|
This is great, thanks @q24609962-svg . Thanks for the review @Dbardgett . @q24609962-svg this is failing pre-commit. there is a problem with the linting. You can see what the fail is by clicking through on the failed check. as a good practice when contributing code, we recommend that you install pre-commit locally. to do this. In your conda environment, install pre-commit then, in the top level directory of the project run to activate it. It will now do the linting checks each time you make a commit (and prevent the commit if it fails). It slows down the commit process (you will see) but speeds up getting PRs merged. Please read more detailed information in the documentation of scikit-package (scikit-package.github.io/scikit-package). Your PR is failing flake8 which requires a manual edit to fix it. |
sbillinge
left a comment
There was a problem hiding this comment.
Thanks @q24609962-svg please see inline comments.
| board, d9 = board_objects[0], board_objects[3] | ||
|
|
||
| # 'Find Potentiostat' | ||
| def find_port(): |
There was a problem hiding this comment.
Is there are reason you are defining functions inside main()? As a general matter, we would prefer this to be done outside main() so main() is just a script that executes.
| _load_arduino(ui) | ||
| ui.find_potentiostat_button.clicked.connect(find_port) | ||
|
|
||
| def disconnect_port(): |
| autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" | ||
| autoupdate_schedule: monthly | ||
| skip: [no-commit-to-branch] | ||
| skip: [no-commit-to-branch, docformatter] |
There was a problem hiding this comment.
please can you try removing both these skips. We don't want to work around the coding standards and then immortalize it in a merge commit if possible.
|
@q24609962-svg I wonder if it makes sense to close this and put these nice edits on a clean PR because of the large changes on the GUI codebase? |


closes #198
Global GUI stylesheet: I updated src/GUI/code/main.py to enforce clear, readable colors across all GUI windows (including CV/CA/LSV creators, experiment list, and port dropdown).
Key addition (already in your file now):
app = QApplication(sys.argv)