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

Fix dock pane undocking #1044

Merged
merged 8 commits into from
Dec 20, 2021
Merged

Fix dock pane undocking #1044

merged 8 commits into from
Dec 20, 2021

Conversation

corranwebster
Copy link
Contributor

Fixes #1028

I am a little concerned there may be issues with serialization of undocked window state that are not fixed by this.

Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>
Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

Mostly LGTM with a couple of comments

pyface/ui/qt4/tasks/tests/test_dock_pane.py Outdated Show resolved Hide resolved
@@ -75,3 +76,28 @@ def check_panes_and_exit(app_event):
self.assertTrue(tool_attributes)
for attr in tool_attributes:
self.assertTrue(attr)

def test_dock_windows_undock(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm not sure why this test wasn't failing earlier with the in/not in problem but from the looks of it, this test is manually undocking a dock pane and then checks the dock area of the dock panes in the app.

I'm not sure why by default undocking a dockpane means that it's left widget area but that's what we seem to be asserting at the end. Do we need to be asserting this at all? Do we care what this value is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've manually verified that this doesn't crash, so I think the state is good.

The test is testing the dockpane area because it should not change when it is undocked (so yes, we do care about the value) - this was a deliberate choice as one option was to add an "undocked" dockpane area, but the behaviour (particularly when restoring from saved state) was unclear.

@corranwebster corranwebster merged commit 82ab911 into main Dec 20, 2021
@corranwebster corranwebster deleted the fix/dock-pane-undocking branch December 20, 2021 10:48
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.

Undocking dock panes fails with PyQt5
2 participants