-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Improve Maintain focus in the editor
option and unmaximize plugins when running/debugging code
#18928
Conversation
This is to be consistent with the same behavior for cells.
Now we maintain the focus in the editor after running or debugging files, cells or selections.
This allows us to correctly set its state when calling switch_to_plugin from plugins programmatically.
- The lack of this made that the calls to switch_to_plugin did nothing when plugins were maximized. - Fix several bugs with switch_to_plugin and the interaction between new and old API plugins.
Hello @ccordoba12! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-08-09 00:09:43 UTC |
Maintain focus in the editor
option and unmaximize plugins when running/debugging codeMaintain focus in the editor
option and unmaximize plugins when running/debugging code
Instead add unmaximize_dockwidget to Layouts and use it where needed.
This goes well with the already existing method close_window
- This makes all these operations consistent with respect to unmaximizing plugins. Before only running and debugging a file did that. - Also expand and simplify tests due to this change
- That makes easier to call that method from other plugins. - Fix call to run_script from Files/Projects, which was broken after adding the focus_to_editor arg to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ccordoba12 ! Checking locally seems like the changes are working as expected and I left some questions regarding code placement.
Otherwise this LGTM 👍
Co-authored-by: Daniel Althviz Moré <d.althviz10@uniandes.edu.co>
Checking locally this again seems like closing the Tour leaves the Maximize toolbar button in a incoherent state (it remains checked although the unmaximized action was done). Also, after closing the tour, should the plugins previously maximized be again maximized @ccordoba12 ? Maybe this was an issue before? |
That way it'll be easier for external plugin developers to ask for this programmatically.
Thanks @dalthviz for manually checking that! I only connected the new I fixed that in my last commit and force pushed it again.
Yep, that was the case before. Since that's a minor thing, I think we should leave it for later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
Description of Changes
Maintain focus to editor
is enabled.Maximize
button when unmaximizing a plugin programmatically from other plugins (this was totally broken).sig_unmaximize_plugin_requested
toSpyderPluginV2
so that plugins can request to unmaximize the currently maximized plugin from others programmatically.unmaximize_dockwidget
andunmaximize_other_dockwidget
methods to the Layout plugin. Also moveswitch_to_plugin
to it.Issue(s) Resolved
Fixes #3221
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: @ccordoba12