Skip to content
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

PR: New menu item for view options in array and dataframe editors #22061

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jitseniesen
Copy link
Member

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)
  • Included a screenshot or animation (if affecting the UI, see Licecap)

This PR adds a new menu item Display options ... to the options menu of the array and dataframe editors. Clicking this menu item brings up a dialog window where the user can set float format, whether to use a background color and what coloring algorithm to use (the last option only appears for dataframe editors). The new menu item replaces the existing icons and menu items for setting these options.

The reason for this PR is that it is not clear what these options do and having a separate dialog window allows us to add more context. See issue #21824 for some discussion. I replaced the text Additional preferences for the menu item, which was suggested in that issue, because I thought we should remove the word "additional" as it is not clear in addition to what these preferences are.

Here is a video showing the new window:

varexp-editor-prefs.mp4

Issue(s) Resolved

Fixes #21824

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct:
Jitse Niesen

* Add new class PreferencesDialog in which the user can pick the format
  for floats and the options for the background color.
* Add an item to the hamburger menu in the dataframe editor which uses
  this dialog for setting the view options.
* Remove the old actions for these view options.
* Add and update tests.
* Update related doc strings in DataFrameModel.
* Add extra parameter to PreferencesDialog to determine whether it's
  setting view options for dataframe or array editor.
* Add item to hamburger menu in array editor which uses this dialog.
* Remove old actions for setting float format and toggling background.
@pep8speaks
Copy link

Hello @jitseniesen! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 1143:13: E722 do not use bare 'except'

Line 2282:13: E722 do not use bare 'except'

@ccordoba12 ccordoba12 modified the milestones: v6.0beta1, v6.0beta2 May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It's not clear what some actions in the new Options menus of Variable Explorer editors do
3 participants