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: Changed code that causes inconsistency in layouts #20141

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spyder/plugins/layout/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ def set_main_window_layout(self, main_window, dockable_plugins):
if plugin:
# Show plugin
plugin.blockSignals(True)
plugin.dockwidget.show()
plugin.toggle_view_action.setChecked(True)
Copy link
Member

Choose a reason for hiding this comment

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

By commenting these two lines you're preventing external plugins to be shown when switching layouts, which is basically what this for loop is doing.

So, you need to find a better solution that preserves this functionality and fixes the bug you found.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @ccordoba12! I'm here working on a better solution that preserves things correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @ccordoba12 how are you? Is the purpose of this loop to keep the third panel (if checked to stay open), eg when I switch from Rstudio layout to Matlab layout?

Copy link
Member

@ccordoba12 ccordoba12 Dec 3, 2022

Choose a reason for hiding this comment

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

Exactly, that's the idea! The problem before I added this loop was that no third-party plugin was shown when switching between different layouts.

But the bug it introduced is that it's not respecting plugins that are declared as not visible in the layout declaration. That must preserved when switching layouts as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, that's exactly what I thought. I'll keep looking for a solution here and let you know. Tks!

Copy link
Contributor Author

@dan123456-eng dan123456-eng Dec 6, 2022

Choose a reason for hiding this comment

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

I fixed the bug. I'll update the PR soon.

#plugin.dockwidget.show()
#plugin.toggle_view_action.setChecked(True)
plugin.blockSignals(False)

# Make visible the first plugin in the dockwidget's tab bar
Expand Down