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: Fix adding corner widgets in dockable plugins (API) #22006

Merged
merged 5 commits into from
Apr 18, 2024

Conversation

ccordoba12
Copy link
Member

@ccordoba12 ccordoba12 commented Apr 18, 2024

Description of Changes

  • Corner widgets were not added in the right order after PR: Initial Editor migration to the new API #21353. This is clear for the IPython console corner widgets, as seen below.
  • Fix before kwarg of PluginMainWidget.add_corner_widget and remove the need to pass an ID to it to make it simpler.
  • Allow to pass actions (i.e. not only widgets) to PluginMainWidget.add_corner_widget.
  • Use these fixes to add corner widgets to the Variable Explorer using our API.

Visual changes

Before After
image image

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:

@pep8speaks
Copy link

pep8speaks commented Apr 18, 2024

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

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-04-18 00:17:17 UTC

That's because we're going to need them in other modules of
spyder.api.widgets too.
- That's cumbersome and not really necessary. Instead, we can use as id
the `name` attribute that most of our API widgets have.
- Use an enum for the IPython console corner widgets with their
respective names.
- Allow to pass a name when creating spinners.
- Also, allow to add either widgets or actions as corner widgets.
- Use all that to simplify the way corner widgets are added in the
Variable Explorer.
…Mixin

That's not necessary anymore because SpyderWidgetMixin inherits from
SpyderToolbarMixin and those widget inherits from it.
@ccordoba12 ccordoba12 changed the title PR: Fix adding widgets to the corner widgets of dockable plugins (API) PR: Fix adding corner widgets in dockable plugins (API) Apr 18, 2024
@ccordoba12 ccordoba12 merged commit 0f6b0b3 into spyder-ide:master Apr 18, 2024
14 checks passed
@ccordoba12 ccordoba12 deleted the fix-adding-to-corner-widget branch April 18, 2024 01:54
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.

None yet

2 participants