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

Toggle file switcher when pressing its keyboard shortcut #3313

Merged
merged 1 commit into from
Jul 20, 2016

Conversation

ccordoba12
Copy link
Member

Fixes #3297

@ccordoba12 ccordoba12 added this to the v3.0beta5 milestone Jul 20, 2016
@ccordoba12 ccordoba12 merged commit d1ddca9 into spyder-ide:master Jul 20, 2016
@ccordoba12 ccordoba12 deleted the hide-file-switcher branch July 20, 2016 19:21
if self.fileswitcher_dlg is not None and \
self.fileswitcher_dlg.is_visible:
self.fileswitcher_dlg.hide()
self.fileswitcher_dlg.is_visible = False
Copy link
Contributor

Choose a reason for hiding this comment

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

This is already supported by Qt, with the visible property. See http://doc.qt.io/qt-4.8/qwidget.html#visible-prop

Copy link
Member Author

Choose a reason for hiding this comment

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

Ops, I didn't know about it. I looked for isVisible but it seems QDialogs don't support it.

I'll change it in master.

Copy link
Member Author

@ccordoba12 ccordoba12 Jul 21, 2016

Choose a reason for hiding this comment

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

It doesn't work with Qt5, so it was probably only available with Qt4.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I'll leave things as they are ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

It is still present in Qt5: http://doc.qt.io/qt-5.6/qwidget.html#visible-prop (and QDialog inherits QWidget). So it should work...
Anyway it's not a big deal, this comment is for completeness only.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to use visible, believe me ;-) It just didn't work, I don't know why...

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I found why. The widget is created on demand, and during initialization the widget is not visible yet so a check with visible() will be wrong. Your code is as good as any other workaround.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, good to know ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants