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

Limit toolbars to MainWindow instances, and allow for MainWindow menus. #2646

Merged
merged 22 commits into from
Jun 19, 2024

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented Jun 13, 2024

Builds on #2643; that PR should be reviewed and merged before reviewing this one.

Derived from #2244.

Modifies the handling of toolbars and menus, so that:

  1. Only a MainWindow (or subclass) is allowed to have a toolbar
  2. On platforms that have window-level menus, menu creation is handled at the window level.

Inadvertently corrects a minor layout issue on GTK (I swear it's been reported, but I can't find the issue), where a MainWindow without any toolbar items has a small padding between the menubar and the toolbar. This was caused because an empty toolbar was still being included in the layout; this implementation only adds the toolbar if it has content.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

core/src/toga/window.py Outdated Show resolved Hide resolved
winforms/src/toga_winforms/app.py Show resolved Hide resolved
core/src/toga/app.py Show resolved Hide resolved
docs/reference/api/mainwindow.rst Outdated Show resolved Hide resolved
docs/reference/api/mainwindow.rst Outdated Show resolved Hide resolved
docs/reference/api/mainwindow.rst Outdated Show resolved Hide resolved
docs/reference/api/mainwindow.rst Outdated Show resolved Hide resolved
docs/reference/data/widgets_by_platform.csv Outdated Show resolved Hide resolved
core/src/toga/window.py Outdated Show resolved Hide resolved
core/src/toga/window.py Outdated Show resolved Hide resolved
changes/2646.removal.2.rst Outdated Show resolved Hide resolved
@mhsmith mhsmith merged commit d129ff1 into beeware:main Jun 19, 2024
31 of 34 checks passed
@freakboy3742 freakboy3742 deleted the mainwindow-toolbar branch June 19, 2024 23:19
@freakboy3742 freakboy3742 mentioned this pull request Jun 26, 2024
4 tasks
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.

2 participants