-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
Bugfix: improve layout of Preferences > Shortcuts tables #5679
Bugfix: improve layout of Preferences > Shortcuts tables #5679
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5679 +/- ##
=======================================
Coverage 90.01% 90.02%
=======================================
Files 618 618
Lines 52827 52831 +4
=======================================
+ Hits 47553 47561 +8
+ Misses 5274 5270 -4
|
# Description <!-- What does this pull request (PR) do? Why is it necessary? --> <!-- Tell us about your new feature, improvement, or fix! --> <!-- If your change includes user interface changes, please add an image, or an animation "An image is worth a thousand words!" --> <!-- You can use https://www.cockos.com/licecap/ or similar to create animations --> Improvements in settings generation when settings have only one field. Also, update name show on top of group to use `title` instead of class name This PR: ![obraz](https://user-images.githubusercontent.com/3826210/230038230-f65c26d9-29b9-4725-9626-a54d558ad9a4.png) Current main: ![obraz](https://user-images.githubusercontent.com/3826210/230038392-f77d9ecf-260c-46db-82d2-e5eec26d9804.png) # References <!-- What resources, documentation, and guides were used in the creation of this PR? --> This PR is inspired by #5679 showed on community meeting ## Type of change <!-- Please delete options that are not relevant. --> - [ ] Refactor # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [ ] example: the test suite for my feature covers cases x, y, and z - [ ] example: all tests pass with my change - [ ] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [ ] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
As #5696 is merged, could you update the branch and post new screenshots? |
Yes, sorry was traveling. I will get on this this weekend. |
06c5980
to
66ed7d2
Compare
I think it will be impossible to satisfy pyside6, pyqt6 and pyqt5 all the way back to 5.12.3 |
Maybe add But also 0.5.0 may be enough to bump Qt requirements. |
Could you update the screenshots in the description? |
Coming back to this, I sort of hated the right justify after all. (I updated the screenshots in OP) |
@psobolewskiPhD I might call this an enhancement more than a bugfix? |
@jni I guess? depends on how you look at the truncated action names. |
Why move to 0.5.0? It is not breaking change, so it is worth trying to backport it. |
I was going off @jni comment, thought he was meaning to move it to 0.5.0 because it's not a bug fix? |
# Description Closes napari#5671 This PR adjusts the layout of the tables used for editing shortcuts such that long action descriptions can be read in their entirety. Briefly: 1) it changes the column widths, to give the text more room 2) as a result of 1, it left aligns the action descriptions so they are visually closer to the keybindings 3) it enables wrapping of long action descriptions 4) as a result of 3, it adjusts the row height and padding Here's the new look: Viewer <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/cfa97346-efeb-425b-b767-00e10da9f71d"> versus `main` without this PR: <img width="1198" alt="image" src="https://user-images.githubusercontent.com/76622105/228291024-39ca5495-75ef-4017-99c4-0ee4bf4238bf.png"> Notice how `Show/hide IPython ...` action has the full description readable, because it's line wrapped. Also, in my opinion the overall layout is more readable and pleasing. Open to suggestions though! New look Labels (main is shown in the issue): <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/3de31dc3-a28a-48ac-b1a8-0be85b1555d7"> Note: the new widths of the keybind columns are set to be sufficient for Ctrl-Alt-Meta-<Letter> with a bit extra left-over. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # References Closes napari#5671 Some discussion of the table is also here napari#5018 this was the PR that implemented the second keybinding column. # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [x] example: all tests pass with my change ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [x] I have commented my code, particularly in hard-to-understand areas --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…5854) # Fixes/Closes Closes #5853 # Description In `qt_keyboard_settings.py` the use of `item.setFlags(Qt.ItemFlag.NoItemFlags)` https://github.com/napari/napari/blob/0dfb37b474490b4d9829c4fa93cb3d648b4b186d/napari/_qt/widgets/qt_keyboard_settings.py#L233 results in these items being `disabled` so as a consequence of #5745 these table items get the reduced opacity leading to reduced contrast. This PR instead uses (❤️ @Czaki ): `item.setFlags(Qt.ItemFlag.ItemIsEnabled)` to ensure these items are `enabled` so that the opacity change does not affect them. # References Noted by @Czaki here #5679 (comment) ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # How has this been tested? - [x] example: all tests pass with my change - [x] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
# Description Closes #5671 This PR adjusts the layout of the tables used for editing shortcuts such that long action descriptions can be read in their entirety. Briefly: 1) it changes the column widths, to give the text more room 2) as a result of 1, it left aligns the action descriptions so they are visually closer to the keybindings 3) it enables wrapping of long action descriptions 4) as a result of 3, it adjusts the row height and padding Here's the new look: Viewer <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/cfa97346-efeb-425b-b767-00e10da9f71d"> versus `main` without this PR: <img width="1198" alt="image" src="https://user-images.githubusercontent.com/76622105/228291024-39ca5495-75ef-4017-99c4-0ee4bf4238bf.png"> Notice how `Show/hide IPython ...` action has the full description readable, because it's line wrapped. Also, in my opinion the overall layout is more readable and pleasing. Open to suggestions though! New look Labels (main is shown in the issue): <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/3de31dc3-a28a-48ac-b1a8-0be85b1555d7"> Note: the new widths of the keybind columns are set to be sufficient for Ctrl-Alt-Meta-<Letter> with a bit extra left-over. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # References Closes #5671 Some discussion of the table is also here #5018 this was the PR that implemented the second keybinding column. # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [x] example: all tests pass with my change ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [x] I have commented my code, particularly in hard-to-understand areas --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…5854) # Fixes/Closes Closes #5853 # Description In `qt_keyboard_settings.py` the use of `item.setFlags(Qt.ItemFlag.NoItemFlags)` https://github.com/napari/napari/blob/0dfb37b474490b4d9829c4fa93cb3d648b4b186d/napari/_qt/widgets/qt_keyboard_settings.py#L233 results in these items being `disabled` so as a consequence of #5745 these table items get the reduced opacity leading to reduced contrast. This PR instead uses (❤️ @Czaki ): `item.setFlags(Qt.ItemFlag.ItemIsEnabled)` to ensure these items are `enabled` so that the opacity change does not affect them. # References Noted by @Czaki here #5679 (comment) ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # How has this been tested? - [x] example: all tests pass with my change - [x] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
# Description Closes #5671 This PR adjusts the layout of the tables used for editing shortcuts such that long action descriptions can be read in their entirety. Briefly: 1) it changes the column widths, to give the text more room 2) as a result of 1, it left aligns the action descriptions so they are visually closer to the keybindings 3) it enables wrapping of long action descriptions 4) as a result of 3, it adjusts the row height and padding Here's the new look: Viewer <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/cfa97346-efeb-425b-b767-00e10da9f71d"> versus `main` without this PR: <img width="1198" alt="image" src="https://user-images.githubusercontent.com/76622105/228291024-39ca5495-75ef-4017-99c4-0ee4bf4238bf.png"> Notice how `Show/hide IPython ...` action has the full description readable, because it's line wrapped. Also, in my opinion the overall layout is more readable and pleasing. Open to suggestions though! New look Labels (main is shown in the issue): <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/3de31dc3-a28a-48ac-b1a8-0be85b1555d7"> Note: the new widths of the keybind columns are set to be sufficient for Ctrl-Alt-Meta-<Letter> with a bit extra left-over. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # References Closes #5671 Some discussion of the table is also here #5018 this was the PR that implemented the second keybinding column. # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [x] example: all tests pass with my change ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [x] I have commented my code, particularly in hard-to-understand areas --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…5854) # Fixes/Closes Closes #5853 # Description In `qt_keyboard_settings.py` the use of `item.setFlags(Qt.ItemFlag.NoItemFlags)` https://github.com/napari/napari/blob/0dfb37b474490b4d9829c4fa93cb3d648b4b186d/napari/_qt/widgets/qt_keyboard_settings.py#L233 results in these items being `disabled` so as a consequence of #5745 these table items get the reduced opacity leading to reduced contrast. This PR instead uses (❤️ @Czaki ): `item.setFlags(Qt.ItemFlag.ItemIsEnabled)` to ensure these items are `enabled` so that the opacity change does not affect them. # References Noted by @Czaki here #5679 (comment) ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # How has this been tested? - [x] example: all tests pass with my change - [x] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
# Description Closes #5671 This PR adjusts the layout of the tables used for editing shortcuts such that long action descriptions can be read in their entirety. Briefly: 1) it changes the column widths, to give the text more room 2) as a result of 1, it left aligns the action descriptions so they are visually closer to the keybindings 3) it enables wrapping of long action descriptions 4) as a result of 3, it adjusts the row height and padding Here's the new look: Viewer <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/cfa97346-efeb-425b-b767-00e10da9f71d"> versus `main` without this PR: <img width="1198" alt="image" src="https://user-images.githubusercontent.com/76622105/228291024-39ca5495-75ef-4017-99c4-0ee4bf4238bf.png"> Notice how `Show/hide IPython ...` action has the full description readable, because it's line wrapped. Also, in my opinion the overall layout is more readable and pleasing. Open to suggestions though! New look Labels (main is shown in the issue): <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/3de31dc3-a28a-48ac-b1a8-0be85b1555d7"> Note: the new widths of the keybind columns are set to be sufficient for Ctrl-Alt-Meta-<Letter> with a bit extra left-over. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # References Closes #5671 Some discussion of the table is also here #5018 this was the PR that implemented the second keybinding column. # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [x] example: all tests pass with my change ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [x] I have commented my code, particularly in hard-to-understand areas --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…5854) # Fixes/Closes Closes #5853 # Description In `qt_keyboard_settings.py` the use of `item.setFlags(Qt.ItemFlag.NoItemFlags)` https://github.com/napari/napari/blob/0dfb37b474490b4d9829c4fa93cb3d648b4b186d/napari/_qt/widgets/qt_keyboard_settings.py#L233 results in these items being `disabled` so as a consequence of #5745 these table items get the reduced opacity leading to reduced contrast. This PR instead uses (❤️ @Czaki ): `item.setFlags(Qt.ItemFlag.ItemIsEnabled)` to ensure these items are `enabled` so that the opacity change does not affect them. # References Noted by @Czaki here #5679 (comment) ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # How has this been tested? - [x] example: all tests pass with my change - [x] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
# Description Closes #5671 This PR adjusts the layout of the tables used for editing shortcuts such that long action descriptions can be read in their entirety. Briefly: 1) it changes the column widths, to give the text more room 2) as a result of 1, it left aligns the action descriptions so they are visually closer to the keybindings 3) it enables wrapping of long action descriptions 4) as a result of 3, it adjusts the row height and padding Here's the new look: Viewer <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/cfa97346-efeb-425b-b767-00e10da9f71d"> versus `main` without this PR: <img width="1198" alt="image" src="https://user-images.githubusercontent.com/76622105/228291024-39ca5495-75ef-4017-99c4-0ee4bf4238bf.png"> Notice how `Show/hide IPython ...` action has the full description readable, because it's line wrapped. Also, in my opinion the overall layout is more readable and pleasing. Open to suggestions though! New look Labels (main is shown in the issue): <img width="1232" alt="image" src="https://github.com/napari/napari/assets/76622105/3de31dc3-a28a-48ac-b1a8-0be85b1555d7"> Note: the new widths of the keybind columns are set to be sufficient for Ctrl-Alt-Meta-<Letter> with a bit extra left-over. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) # References Closes #5671 Some discussion of the table is also here #5018 this was the PR that implemented the second keybinding column. # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [x] example: all tests pass with my change ## Final checklist: - [x] My PR is the minimum possible work for the desired functionality - [x] I have commented my code, particularly in hard-to-understand areas --------- Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
<!-- What does this pull request (PR) do? Why is it necessary? --> <!-- Tell us about your new feature, improvement, or fix! --> <!-- If your change includes user interface changes, please add an image, or an animation "An image is worth a thousand words!" --> <!-- You can use https://www.cockos.com/licecap/ or similar to create animations --> Improvements in settings generation when settings have only one field. Also, update name show on top of group to use `title` instead of class name This PR: ![obraz](https://user-images.githubusercontent.com/3826210/230038230-f65c26d9-29b9-4725-9626-a54d558ad9a4.png) Current main: ![obraz](https://user-images.githubusercontent.com/3826210/230038392-f77d9ecf-260c-46db-82d2-e5eec26d9804.png) <!-- What resources, documentation, and guides were used in the creation of this PR? --> This PR is inspired by #5679 showed on community meeting <!-- Please delete options that are not relevant. --> - [ ] Refactor <!-- Please describe the tests that you ran to verify your changes. --> - [ ] example: the test suite for my feature covers cases x, y, and z - [ ] example: all tests pass with my change - [ ] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. - [ ] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
Description
Closes #5671
This PR adjusts the layout of the tables used for editing shortcuts such that long action descriptions can be read in their entirety. Briefly:
Here's the new look: Viewer
![image](https://private-user-images.githubusercontent.com/76622105/241036529-cfa97346-efeb-425b-b767-00e10da9f71d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNzAwNzUsIm5iZiI6MTcyMDM2OTc3NSwicGF0aCI6Ii83NjYyMjEwNS8yNDEwMzY1MjktY2ZhOTczNDYtZWZlYi00MjViLWI3NjctMDBlMTBkYTlmNzFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDE2MjkzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTljOGVjNmI5Y2IzYzZjOTg4MGY1YjIxZGNlYTEzZmZjYWMzMDJjYzZkNDhmMDZkNjE1YzhkMjdiYWY1OGUwYWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bFab_g4TtmfzIt9NYdGhmoJwBgLl5VwWgvKyeqOXWVY)
versus
![image](https://user-images.githubusercontent.com/76622105/228291024-39ca5495-75ef-4017-99c4-0ee4bf4238bf.png)
main
without this PR:Notice how
Show/hide IPython ...
action has the full description readable, because it's line wrapped. Also, in my opinion the overall layout is more readable and pleasing.Open to suggestions though!
New look Labels (main is shown in the issue):
![image](https://private-user-images.githubusercontent.com/76622105/241036626-3de31dc3-a28a-48ac-b1a8-0be85b1555d7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzNzAwNzUsIm5iZiI6MTcyMDM2OTc3NSwicGF0aCI6Ii83NjYyMjEwNS8yNDEwMzY2MjYtM2RlMzFkYzMtYTI4YS00OGFjLWIxYTgtMGJlODViMTU1NWQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDE2MjkzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdlNjVhYmM4MDg5MWQ0MDUyNTU5YzhhNzZlMzIwNTljZGE0YzZmZDAzOTk2MzJjNzU4NjJkMDVhZDViYzRmNzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.NB7PXwVX28hmJwPDHPiP88iNe0vocpLFsy9OWwScP7Y)
Note: the new widths of the keybind columns are set to be sufficient for Ctrl-Alt-Meta- with a bit extra left-over.
Type of change
References
Closes #5671
Some discussion of the table is also here #5018
this was the PR that implemented the second keybinding column.
How has this been tested?
as there are small differences between the two Qt bindings.
Final checklist:
trans.
to make them localizable.For more information see our translations guide.