Code Monkey home page Code Monkey logo

Comments (2)

whiplashoo avatar whiplashoo commented on July 3, 2024 1

OK, so I did some research on how the Toolbar widget should be implemented to match Apple design:

A ToolBar should be a different widget from the TitleBar. A ToolBar though, can also be integrated with the TitleBar (i.e. it can include the app's title info, traditionally in the beginning). More info and examples:

Keynote app (title bar + tool bar):

Screenshot 2022-04-23 at 12 09 10 AM

Sketch app (integrated tool bar):

Screenshot 2022-04-23 at 12 09 02 AM

So, a user should be able to choose and use a preferred window layout:

  • with a title bar (and optionally, a toolbar below it),
  • with just an integrated toolbar
  • without either a title bar or a toolbar (e.g. the Facetime app).

The issue is that including a title bar affects the placement of the traffic lights buttons (close, minimize, zoom), as shown in above screenshots. So, this should be decided beforehand, as it's necessary to set the toolbarStyle setting with Swift code in MainFlutterWindow.swift:

if #available(macOS 11.0, *) {
  // Use .expanded if the app will have a title bar, else use .unified
  self.toolbarStyle = .expanded
} 

So, my plan for implementing the ToolBar widget is to:

  • Simplify the existing TitleBar widget to only hold one widget (most probably, a Text widget with the app's name).
  • Move the TitleBar widget to MacosWindow (instead of the MacosScaffold), as it should be used app-wide.
  • Add a ToolBar widget to the Scaffold, similar to the previous TitleBar widget, that will hold all the toolbar items, a navigational back button, as well as an optional title slot (like in the Sketch screenshot).
  • Communicate how to set the proper toolbar style via Swift code in the docs.
  • Implement relevant widgets for the toolbar items.

Of course, all these changes will lead to some breaking changes for users that have been using the title bar until now (including me 😄).

A first iteration of this:
Screenshot 2022-04-23 at 12 27 05 AM

Any thoughts or feedback would be welcome! @GroovinChip

from macos_ui.

GroovinChip avatar GroovinChip commented on July 3, 2024 1

@whiplashoo this all looks great! One comment I have is that we should figure out a way to allow users to choose if the dividers between the titlebar/toolbar/content area should be visible or not, since some apps (like the ones in your screenshots) do not show them.

from macos_ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.