+
Skip to content

Conversation

kkoreilly
Copy link
Member

@kkoreilly kkoreilly commented Sep 2, 2024

After the initial release, one of the biggest complaints and questions was about the ability to remove the top app bar. People accurately saw the top app bar as excessively opinionated and an inefficient use of screen real estate. Therefore, I have completed a major refactoring of our approach to this area.

Overall, this represents a significant improvement that will decrease bloat, increase developer control, and ease future changes. The v0.4 release notes will contain a more accessible summary of the changes made in this PR.

Here are the main changes:

  • The concept of the AppBar / AppBars / TopAppBar has been removed entirely.
    • The Bars / TopBar etc still exist.
    • If you want to add a Toolbar inside of the TopBar, that is still completely possible and encouraged, but exclusively in your control, with no automatic support (see the bottom of the toolbars page for an example).
  • The buttons that were formerly automatically and irrevocably added to the TopAppBar overflow menu have been relocated to the default Scene.ContextMenus.
    • The Scene.ContextMenus are now automatically inherited by all widgets within the scene.
    • The Scene.ContextMenus are also included when fetching keyboard shortcuts.
    • These default context menus are critically now easily removable in one line of code (see the bottom of the context menus page).
  • The former AppChooser (the search chooser in the TopAppBar) has been relocated to a button in the default scene context menu and renamed to MenuSearch.
    • The menu search can be customized by implementing the MenuSearcher interface on a widget.
  • The former back button always present in the TopAppBar has been made contextual such that it will only show up when needed (in FullWindow but not NewWindow dialogs and windows).
    • This greatly limits the scope of the back button such that it no longer exists in cases in which it is duplicative with already existing native controls. This means that the previously existing Stage.CloseOnBack property has been removed.
    • There is now a Stage.BackButton property for changing whether the back button is added.
    • There is also now a separate back button in the pages toolbar for returning to the previous page that also only shows up when needed.
  • The previous extremely unidiomatic and poorly named Body.AddTitle and Body.AddText functions have been removed.
    • The name/title passed to NewBody is now automatically used to make a title widget in dialogs. You can change this behavior by setting Stage.DisplayTitle.
    • Instead of calling Body.AddText, you can make a standard text widget with NewText and set its Text.Type to the new TextSupporting.
    • See the dialogs page for examples of these new approaches.

Here are some other changes that indirectly resulted from the main changes:

  • The already largely defunct BarsInherit became entirely useless and was removed.
  • Apps can now directly add any manual OverflowMenus they want to any Toolbars they make in the TopBar, so the awkward tree.Plan.Parent has been removed.
  • BarFuncs (such as for TopBar etc) now take a bar *Frame instead of a parent Widget, which is effectively the same but makes things much clearer and less ambiguous.
  • The old and unnecessary GetTopAppBar and GetBar functions have been removed.
  • The FilePicker has been improved to have its own directory Chooser at the top, since it no longer integrates with a centralized app chooser.
  • Context menus now have their own docs page.
  • Various minor improvements have been made to context menu separator logic and menu search item finding logic.

This fixes #1074 and supersedes and thus closes #1072.

…h new back button structure limited to full window dialogs
@rcoreilly rcoreilly merged commit b432919 into main Sep 2, 2024
1 check passed
@rcoreilly rcoreilly deleted the app-bar branch September 2, 2024 17:29
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.

Improve app bar

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载