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

wx.lib.agw.aui Minimize pane issue #2361

Closed
tianzhuqiao opened this issue Mar 6, 2023 · 0 comments · Fixed by #2447
Closed

wx.lib.agw.aui Minimize pane issue #2361

tianzhuqiao opened this issue Mar 6, 2023 · 0 comments · Fixed by #2447

Comments

@tianzhuqiao
Copy link

Operating system: MacOS 13.2.1
wxPython version & source: 4.2.0
Python version & source: 3.9.5

Description of the problem:
When drag a notebook page and dock it somewhere, it will not be able to be minimized.

aui_minimize_pane_fail

The issues comes from the discrepancy between the paneinfo in AuiManager._panes and AuiManager._uiparts.

def OnLeftUp_DragFloatingPane(self, eventOrPt):
        ...
        # here we change the paneinfo in _panes, but Update() may not be called

        # reorder for dropping to a new notebook
        # (caution: this code breaks the reference!)
        tempPaneInfo = self.CopyTarget(paneInfo)
        self._panes.remove(paneInfo)
        self._panes.append(tempPaneInfo)

        if ret:
            self.Update()

        if tempPaneInfo.IsFloating():
            self.SnapPane(tempPaneInfo, tempPaneInfo.floating_pos, tempPaneInfo.floating_size, False)
    ...

Looks like if we move the "reorder" part in the if ret section, the problem goes away.

def OnLeftUp_DragFloatingPane(self, eventOrPt):
        ...
        if ret:
            # reorder for dropping to a new notebook
            # (caution: this code breaks the reference!)
            tempPaneInfo = self.CopyTarget(paneInfo)
            self._panes.remove(paneInfo)
            self._panes.append(tempPaneInfo)

            self.Update()

            if tempPaneInfo.IsFloating():
                self.SnapPane(tempPaneInfo, tempPaneInfo.floating_pos, tempPaneInfo.floating_size, False)
    ...

aui_minimize_pane_pass

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 a pull request may close this issue.

1 participant