Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PR: Remove modality of figure options #18966

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

Merged
merged 3 commits into from
Jul 7, 2021

Conversation

impact27
Copy link
Contributor

@impact27 impact27 commented Nov 17, 2020

PR Summary

The figure options dialogue is no longer modal, which means the figure can be interacted with while the dialogue is open, and it fixes #18965

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@impact27
Copy link
Contributor Author

I am not sure if this counts as an API change or a new feature.

@anntzer
Copy link
Contributor

anntzer commented Feb 23, 2021

The feature seems reasonable to me.

@tacaswell
Copy link
Member

@impact27 Could you rebase this on to master? I'm happy to provide any git-support (or do it for you).

@tacaswell tacaswell added this to the v3.5.0 milestone Feb 23, 2021
@impact27
Copy link
Contributor Author

I am wondering if I should just remove the modality? Does it really make sense to block the application while the option are chosen? I left it as an option as of now.
This PR is really useful for Spyder. In Spyder kernel, some messages are processed in the background while debugging. If this happens while the options is open without this PR, the kernel crashes, as described in #18965.

@jklymak jklymak marked this pull request as draft May 8, 2021 22:06
@jklymak
Copy link
Member

jklymak commented May 8, 2021

@impact27 if you'd still like this in, please be sure to ping us for reviews.

@impact27 impact27 marked this pull request as ready for review May 31, 2021 05:34
@@ -0,0 +1,7 @@
Modality of _formlayout
~~~~~~~~~~~~~~~~~~~~~~~
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is failing the docs build.

Does this have a champion in the core devs?

@QuLogic
Copy link
Member

QuLogic commented Jun 8, 2021

I'm not sure we need to document changes to things that are private. And if the only consumer doesn't expose that option to the outside world, then we don't need the old way (modality) to stick around either.

@jklymak jklymak marked this pull request as draft June 10, 2021 14:09
@jklymak
Copy link
Member

jklymak commented Jun 10, 2021

@impact27 feel free to mark as ready for review when you remove the API note. I think this is close? Also, please ping for reviews as things fall off the bottom of the queue...

@tacaswell
Copy link
Member

I am in favor of just always making this window non-modal.

@impact27 impact27 changed the base branch from master to v3.4.x June 11, 2021 12:02
@impact27 impact27 changed the base branch from v3.4.x to master June 11, 2021 12:03
@impact27 impact27 changed the base branch from master to v3.4.x June 11, 2021 12:03
@impact27
Copy link
Contributor Author

I updated the PR. Should it be against master?

@impact27 impact27 marked this pull request as ready for review June 11, 2021 14:03
@jklymak
Copy link
Member

jklymak commented Jun 11, 2021

Yes definitely against master!

@jklymak jklymak marked this pull request as draft June 11, 2021 16:26
@QuLogic QuLogic changed the base branch from v3.4.x to master June 11, 2021 21:02
@QuLogic
Copy link
Member

QuLogic commented Jun 15, 2021

There's also the problem that now that the figure can be interacted with again, if you change the things that appear in the dialog by touching the figure (e.g., using zoom/pan, shortcuts for change scales, etc.), then this is not reflected in the dialog, which didn't have to contend with that before.

@impact27
Copy link
Contributor Author

There's also the problem that now that the figure can be interacted with again, if you change the things that appear in the dialog by touching the figure (e.g., using zoom/pan, shortcuts for change scales, etc.), then this is not reflected in the dialog, which didn't have to contend with that before.

Not really, you can type plt.xlim([1, 2]) in the console and the dialog won't be updated either, so I don't think this sould be part of this PR.

@impact27
Copy link
Contributor Author

This seems to have broken the Configure subplots button. I guess you missed one of the callers.

I will look into this

@impact27
Copy link
Contributor Author

This should be working again.

@jklymak jklymak requested a review from QuLogic June 16, 2021 16:23
@QuLogic
Copy link
Member

QuLogic commented Jun 17, 2021

Not really, you can type plt.xlim([1, 2]) in the console and the dialog won't be updated either, so I don't think this sould be part of this PR.

Fair enough; it should probably be fixed at some point though.

@@ -820,7 +823,7 @@ def _export_values(self):
QtGui.QFontMetrics(text.document().defaultFont())
.size(0, text.toPlainText()).height() + 20)
text.setMaximumSize(size)
dialog.exec_()
self._export_values_dialog.show()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we leave this as modal, will it block the main window, or just the subplot tool? I think it would be best if it blocked the tool, but not the main window, if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, everything happens on a single thread, so it would not be possible as exec_ would block the thread.

@impact27
Copy link
Contributor Author

Fair enough; it should probably be fixed at some point though.

I'm not sure, I could see an usecase where I open the settings, then zoom on the graph so I know where I want to set the limits for example. What would happen if I am editing the limits, then I move the graph? Is my work lost?

@QuLogic
Copy link
Member

QuLogic commented Jun 25, 2021

Can you rebase and delete the last two commits (since they're inverses)?

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging on the strength of @QuLogic review - hopefully @impact27 will come back and help if this breaks anyone down the line.

@jklymak jklymak merged commit 5b31071 into matplotlib:master Jul 7, 2021
@impact27 impact27 mentioned this pull request Jan 11, 2022
6 tasks
impact27 added a commit to impact27/matplotlib that referenced this pull request Jan 22, 2022
tacaswell added a commit that referenced this pull request Jan 27, 2022
DOC: update documentation after #18966
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jan 27, 2022
tacaswell added a commit that referenced this pull request Jan 27, 2022
…288-on-v3.5.x

Backport PR #22288 on branch v3.5.x (update documentation after #18966)
stanleyjs pushed a commit to stanleyjs/matplotlib that referenced this pull request Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Figure options with qt backend breaks
5 participants