active_editor not update in AdvancedEditorAreaPane #63

Open
pberkes opened this Issue Oct 30, 2012 · 11 comments

Projects

None yet

4 participants

@pberkes
Contributor
pberkes commented Oct 30, 2012

In new AdvancedEditorAreaPane, if I split the area in two, the active_area trait is not updated when I left-click on one or the other parts of the split.

@agrawalprash
Contributor

This has been now fixed here: agrawalprash@0172326

Please try this one out (I'm not sending a PR since this AdvancedEditorAreaPane is now going to be called SplitEditorAreaPane and the old AdvancedEditorAreaPane would be made available, so I will send a PR once this renaming has been done).

@pberkes
Contributor
pberkes commented Oct 31, 2012

Thanks, that works if I click on the editors tabs. If I click on the
content, then the active_editor still does not change.

On Wed, Oct 31, 2012 at 12:08 PM, Prashant Agrawal <notifications@github.com

wrote:

This has been now fixed here: agrawalprash/pyface@0172326agrawalprash@0172326

Please try this one out (I'm not sending a PR since this
AdvancedEditorAreaPane is now going to be called SplitEditorAreaPane and
the old AdvancedEditorAreaPane would be made available, so I will send a PR
once this renaming has been done).


Reply to this email directly or view it on GitHubhttps://github.com/enthought/pyface/issues/63#issuecomment-9942294.

Pietro Berkes
Scientific software developer
Enthought UK

@pberkes
Contributor
pberkes commented Oct 31, 2012

This seems to work:

    def _focus_changed(self, old, new):
        """ Handle an application-level focus change to set the active_tabwidget
        """
        if new:
            if isinstance(new, DraggableTabWidget):
                self.active_tabwidget = new
            elif isinstance(new, QtGui.QTabBar):
                self.active_tabwidget = new.parent()
            else:
                # Get the editor that contains the widget that got focus,
                # and activate it
                for editor in self.editors:
                    if editor.control.isAncestorOf(new):
                        self.activate_editor(editor)
                        break

The change is from editor.control.hasFocus() to editor.control.isAncestorOf(new), as in the old advanced editor area.

@pberkes
Contributor
pberkes commented Oct 31, 2012

To clarify: this fix is in addition to the one proposed by @agrawalprash .

There is another fix I'd like to propose regarding active_editor: add_editor does not activate the editor it adds. Is it by design? If so, I think active_editor should still be set if editor is the first editor added to the editor area:active_editor may still be None even though there is an editor in the area.

@agrawalprash
Contributor

I think this was a bug (add_editor should activate the added editor) which I have fixed on my own repo: https://github.com/agrawalprash/pyface/commits/update_active_editor (I have also made the isAncestorOf change you suggested there)

@pberkes
Contributor
pberkes commented Nov 9, 2012

@agrawalprash As far as I can tell this has not been merged yet. Do you have any plan to submit a PR?

@agrawalprash
Contributor

Yes, I was little preoccupied with other projects, I will send a PR in a
couple of days probably (it's holiday time here now). Let me know if it is
urgent, I will try to send one asap.

On Fri, Nov 9, 2012 at 7:56 PM, Pietro Berkes notifications@github.comwrote:

@agrawalprash https://github.com/agrawalprash As far as I can tell this
has not been merged yet. Do you have any plan to submit a PR?


Reply to this email directly or view it on GitHubhttps://github.com/enthought/pyface/issues/63#issuecomment-10227945.

Prashant Agrawal
Software Developer
Enthought India

@pberkes
Contributor
pberkes commented Nov 9, 2012

Thanks, it's not urgent, I have it patched on my side.
Happy holidays!

On Fri, Nov 9, 2012 at 2:44 PM, Prashant Agrawal
notifications@github.comwrote:

Yes, I was little preoccupied with other projects, I will send a PR in a
couple of days probably (it's holiday time here now). Let me know if it is
urgent, I will try to send one asap.

On Fri, Nov 9, 2012 at 7:56 PM, Pietro Berkes notifications@github.comwrote:

@agrawalprash https://github.com/agrawalprash As far as I can tell
this
has not been merged yet. Do you have any plan to submit a PR?


Reply to this email directly or view it on GitHub<
https://github.com/enthought/pyface/issues/63#issuecomment-10227945>.

Prashant Agrawal
Software Developer
Enthought India

Reply to this email directly or view it on GitHubhttps://github.com/enthought/pyface/issues/63#issuecomment-10228461.

Pietro Berkes
Scientific software developer
Enthought UK

@dpinte
Member
dpinte commented Mar 20, 2015

@agrawalprash it's been a long time but would be great to get this fixed if you can

@pberkes pberkes referenced this issue in agrawalprash/pyface Apr 5, 2016
@agrawalprash agrawalprash FIX: Adds trait change handler to update active_editor when active_ta…
…bwidget changes.

This fixes a bug which doesn't update active_editor when the user clicks
on one or other parts of the split right after creating a split.
0172326
@mdickinson
Member

See #203 for a fix for the originally-reported issue. @pberkes: the comments report various issues and fixes; do you want to open additional GitHub issues for things not directly related to the active_editor trait?

@pberkes
Contributor
pberkes commented Apr 6, 2016

I opened #205 . Anything else?

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