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

[widget Audit] toga.Window #2058

Merged
merged 47 commits into from
Oct 17, 2023
Merged

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented Jul 31, 2023

Audit of Window and MainWindow.

  • The need to explicitly assign non-main windows to the app has been removed; this makes the main window consistent with all other windows, fixing a common source of error (see Change 'Window' object has no attribute 'viewport' error to something more useful #1804).
  • multiselect has been renamed multiple_select, for consistency with Table, Tree, etc.
  • resizeable and closeable have been renamed to match US spelling.
  • There's a schism in the testbed tests, as mobile platforms have fundamentally different characteristics. I've shared as many tests as possible, but there's a branch in the test_window testbed file to differentiate between mobile and desktop; and the requirements of the window probe are significantly different.
  • I've modified iOS to raise an actual exception if you try to create a secondary window. This never worked in the past because it conceptually makes no sense; hopefully the error message will now give users an indication why.
  • GTK Window testing has some interesting omissions/skips, because X/Wayland has Opinions(tm) about what an app can do to its own windows. Even though GTK has APIs like iconify(), they're explicitly documented as "this might do nothing, depending on the window manager".

Fixes:

Audit checklist

  • Core tests ported to pytest
  • Core tests at 100% coverage
  • Core docstrings complete, and in Sphinx format
  • Documentation complete and consistently formatted
  • cocoa backend at 100% coverage
  • winforms backend at 100% coverage
  • gtk backend at 100% coverage
  • iOS backend at 100% coverage
  • android backend at 100% coverage
  • Widget support table updated
  • Widget Issue backlog reviewed

Copy link
Member

@samschott samschott left a comment

Choose a reason for hiding this comment

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

I've had a look at this because it forms the base line for #2061 and was curious about such fundamental changes. I've mostly left comments regarding the macOS part, this is not a proper review and more of a curious glance :)

Generally I have the impression that the relationship between widgets and containers is a lot clearer now, in large parts also thanks to #1969!

cocoa/src/toga_cocoa/app.py Show resolved Hide resolved
cocoa/src/toga_cocoa/app.py Outdated Show resolved Hide resolved
cocoa/src/toga_cocoa/app.py Show resolved Hide resolved
cocoa/src/toga_cocoa/dialogs.py Show resolved Hide resolved
cocoa/src/toga_cocoa/widgets/optioncontainer.py Outdated Show resolved Hide resolved
core/src/toga/window.py Outdated Show resolved Hide resolved
@freakboy3742 freakboy3742 mentioned this pull request Oct 6, 2023
4 tasks
@freakboy3742 freakboy3742 merged commit b81f1ef into beeware:main Oct 17, 2023
41 checks passed
@freakboy3742 freakboy3742 deleted the audit-window branch October 17, 2023 23: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
3 participants