Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix split editor area pane focus #89

Merged
merged 5 commits into from Jun 21, 2013

Conversation

Projects
None yet
2 participants
Contributor

pberkes commented Jun 20, 2013

If an editor contains tabs, after certain operations (e.g., navigating
the editor tabs using keyboard shortcuts) a change in focus
sets the editor area pane active_tabwidget to one of those internal tabs,
rather than to the tab of the editor in the editor area.

This causes problems, e.g. in this example I added two editors, and one got inserted inside the other:

image

Pietro Berkes added some commits Jun 20, 2013

Fix a bug with setting the active tabwidget when an editor contains t…
…abs.

If an editor contains tabs, after certain operations (e.g., navigating
the editor tabs using keyboard shortcuts) a change in focus
sets the editor area pane `active_tabwidget` to one of those internal tabs,
rather than to the tab of the editor in the editor area.
Contributor

pberkes commented Jun 20, 2013

@agrawalprash @pankajp Hopefully, I got your intention right here... Could you please review and see if the fix makes sense? I'm still a bit insecure when it comes to having multiple splits.

@agrawalprash agrawalprash commented on an outdated diff Jun 20, 2013

pyface/util/testing.py
@@ -0,0 +1,47 @@
+# Copyright (c) 2013 by Enthought, Inc., Austin, TX
+# All rights reserved.
+# This file is confidential and NOT open source. Do not distribute.
+""" Tools for testing. """
+
+
+from contextlib import contextmanager
+
+from pyface.qt.QtCore import QTimer
+from pyface.util.guisupport import get_app_qt4
+
+
+@contextmanager
+def event_loop():
@agrawalprash

agrawalprash Jun 20, 2013

Contributor

Can you please either rename this to event_loop_qt or move it to ui.qt4.utils? Thanks.

@agrawalprash agrawalprash and 1 other commented on an outdated diff Jun 20, 2013

pyface/util/testing.py
+
+
+@contextmanager
+def event_loop():
+ """ Post and process the Qt events at the exit of the code block. """
+
+ app = get_app_qt4()
+
+ yield
+
+ app.sendPostedEvents()
+ app.processEvents()
+
+
+@contextmanager
+def delete_widget(widget, timeout=1.0):
@agrawalprash

agrawalprash Jun 20, 2013

Contributor

This one too.

@pberkes

pberkes Jun 20, 2013

Contributor

Good point, I'll make the changes tomorrow.

Contributor

agrawalprash commented Jun 20, 2013

@pberkes Thanks for catching this case and fixing it. And thanks for PEP8'ing it. Apart from a minor comment, this looks good to me.

Contributor

pberkes commented Jun 21, 2013

@agrawalprash I moved the qt-specific testing utils to pyface.ui.qt4.util

agrawalprash added a commit that referenced this pull request Jun 21, 2013

@agrawalprash agrawalprash merged commit 8d896ff into master Jun 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment