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

Add a Toga.SimpleApp base class #1870

Closed
freakboy3742 opened this issue Apr 15, 2023 · 6 comments · Fixed by #2649
Closed

Add a Toga.SimpleApp base class #1870

freakboy3742 opened this issue Apr 15, 2023 · 6 comments · Fixed by #2649
Labels
enhancement New features, or improvements to existing features.

Comments

@freakboy3742
Copy link
Member

What is the problem or limitation you are having?

Toga.App includes a number of features that may not be desirable on all apps.

On Windows and GTK, the main window of a Toga app includes a menubar.

On iOS and Android, the main window contains a titlebar.

The titlebar provided by the web backend may also be undesirable in some situations.

Describe the solution you'd like

Toga should offer a Toga.SimpleApp base class that only includes the bare minimum of decorations.

SimpleApp should not support menus or toolbars. It should not draw a titlebar on its main window. Any commands that are registered should only be accessible as keyboard shortcuts.

Toga.App should subclass Toga.SimpleApp to add these additional features.

The MainWindow instantiated by the app may also need a "Simple" variant.

Describe alternatives you've considered

Provide a formal API to turn off menus, toolbars etc on a feature-by-feature basis. This is problematic because of platforms like macOS, where menus are non-optional.

Additional context

#733 was an original request for this feature.

@Jzhenli
Copy link

Jzhenli commented Jun 15, 2023

Hi, what's the status for this feature? @freakboy3742

@freakboy3742
Copy link
Member Author

It's waiting for an implementation. It's not on the short term roadmap of the core team, but if someone were to provide an implementation, it would get reviewed, and if the review was positive, merged into main.

@Jzhenli
Copy link

Jzhenli commented Aug 7, 2024

It's waiting for an implementation. It's not on the short term roadmap of the core team, but if someone were to provide an implementation, it would get reviewed, and if the review was positive, merged into main.

@freakboy3742 this issue have been closed, so now we can remove the title bar for android app? if can, would u give brief example? thanks.
image

@freakboy3742
Copy link
Member Author

It's been fixed in the main branch, but isn't in a stable release yet.

As for how to use it - when you set the main window, use an instance of toga.Window, not toga.MainWindow. See the SimpleApp example for usage (noting again that you will need to use the git version of Toga to have this feature, not just the version you get from pip install toga)

@Jzhenli
Copy link

Jzhenli commented Aug 7, 2024

It's been fixed in the main branch, but isn't in a stable release yet.

As for how to use it - when you set the main window, use an instance of toga.Window, not toga.MainWindow. See the SimpleApp example for usage (noting again that you will need to use the git version of Toga to have this feature, not just the version you get from pip install toga)

@freakboy3742 how to install the git version?

@mhsmith
Copy link
Member

mhsmith commented Aug 7, 2024

See #2032 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
3 participants