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

Custom layouts show panels that have ''visible=False'' #20078

Open
dan123456-eng opened this issue Nov 17, 2022 · 10 comments
Open

Custom layouts show panels that have ''visible=False'' #20078

dan123456-eng opened this issue Nov 17, 2022 · 10 comments

Comments

@dan123456-eng
Copy link
Contributor

dan123456-eng commented Nov 17, 2022

Problem Description

Custom layouts show panels with ''visible=False'' and third-party panels that are not part of a custom layout.

Custom layout in Spyder 5.3.2 with '' visible=False'':
self.add_area([SpyderPyMR.NAME], row=3, column=1, visible=False, )
img3

Custom layout in Spyder 5.4.0 with '' visible=False'':
self.add_area([SpyderPyMR.NAME], row=3, column=1, visible=False, )

im2

What steps reproduce the problem?

  1. View
  2. Window layouts
  3. layout

Versions

  • Spyder version: 5.4.0
  • Python version: 3.8
  • Qt version:
  • PyQt version:
  • Operating System name/version: Windows10
@dan123456-eng dan123456-eng changed the title After closing a third-party or Spyder panel, it returns to the screen again (it also opens in custom layouts) Custom layouts do not save state Nov 17, 2022
@dan123456-eng dan123456-eng changed the title Custom layouts do not save state Custom layouts show panels that have ''visible=False'' Nov 18, 2022
@ccordoba12
Copy link
Member

Hey @dan123456-eng, thanks for reporting. I think I introduced this regression and will try to fix it in the first version we'll release next year (5.4.2).

@dan123456-eng
Copy link
Contributor Author

Hey @dan123456-eng, thanks for reporting. I think I introduced this regression and will try to fix it in the first version we'll release next year (5.4.2).

Thanks @ccordoba12 ! I hope to contribute more actively.

@ccordoba12
Copy link
Member

You mean that you'd like to solve this problem? Because I can give you some pointers to get you started.

@dan123456-eng
Copy link
Contributor Author

Quer dizer que gostaria de resolver esse problema? Porque eu posso lhe dar algumas dicas para você começar.

If you can give the tips I can try to solve. Tks

@ccordoba12
Copy link
Member

ccordoba12 commented Nov 28, 2022

Great! I think I could have introduced this problem when I added support to restore the visible plugins in the previous session. I did that in PR #18962.

So I'll start taking a look at that, to see if commenting that functionality fixes the issue.

@dan123456-eng
Copy link
Contributor Author

dan123456-eng commented Nov 28, 2022

Hello @ccordoba12 . Thanks for that tip. I'll take a look.
I commented the code snippet below and apparently the problem did not occur:

    # Restore displayed external plugins
    for plugin_id in external_plugins_to_show:
        plugin = main_window.get_plugin(plugin_id, error=False)
        if plugin:
            # Show plugin
            plugin.blockSignals(True)
            plugin.dockwidget.show()
            plugin.toggle_view_action.setChecked(True)
            plugin.blockSignals(False)

            # Make visible the first plugin in the dockwidget's tab bar
            # because it should be an internal one.
            dock_tabbar = plugin.dockwidget.dock_tabbar
            if dock_tabbar:
                dock_tabbar.setCurrentIndex(0)

@dan123456-eng
Copy link
Contributor Author

->plugin.dockwidget.show()
->plugin.toggle_view_action.setChecked(True)

@ccordoba12
Copy link
Member

ccordoba12 commented Nov 28, 2022

Great! I'm really glad you were able to find the solution to this issue!

Could you create a pull request for it? If you decide to do that, please don't forget to read our Contributing guide first.

If you don't comfortable with that, let us know and I can do it for you.

@ccordoba12 ccordoba12 modified the milestones: v5.4.2, v5.4.1 Nov 28, 2022
@dan123456-eng
Copy link
Contributor Author

Thanks for helping! I will make the pull request.

@ccordoba12
Copy link
Member

Nice! Thanks a lot for your help with this!

dan123456-eng added a commit to dan123456-eng/spyder that referenced this issue Dec 8, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.4.1, v5.4.2 Dec 26, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.4.2, v5.4.3 Jan 5, 2023
@ccordoba12 ccordoba12 modified the milestones: v5.4.3, v5.4.4 Mar 22, 2023
@ccordoba12 ccordoba12 modified the milestones: v5.4.4, v5.5.0 Jun 22, 2023
@ccordoba12 ccordoba12 modified the milestones: v5.5.0, v6.0alpha3 Oct 20, 2023
@ccordoba12 ccordoba12 modified the milestones: v6.0alpha3, v6.0beta1 Nov 17, 2023
@ccordoba12 ccordoba12 modified the milestones: v6.0alpha4, v6.0beta1 Feb 6, 2024
@ccordoba12 ccordoba12 modified the milestones: v6.0alpha5, v6.0beta1 Mar 12, 2024
@ccordoba12 ccordoba12 modified the milestones: v6.0beta1, v6.1.0 May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants