Comments (2)
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):
Sketch app (integrated tool bar):
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, aText
widget with the app's name). - Move the
TitleBar
widget toMacosWindow
(instead of theMacosScaffold
), as it should be used app-wide. - Add a
ToolBar
widget to the Scaffold, similar to the previousTitleBar
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 😄).
Any thoughts or feedback would be welcome! @GroovinChip
from macos_ui.
@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)
- Search field with results should allow using the up and down arrow keys to move through the results, and enter to select a result
- Theme change doesn't correctly adapt to system HOT 5
- `CapacityIndicator` documentation images are not found HOT 1
- Unable to build with CocoaPods could not find compatible versions for pod "macos_window_utils" error. HOT 4
- Native looking osx preference window? HOT 1
- wrong PushButton color HOT 16
- Add guide on changing the application’s accent color to readme
- close button suddenly not working HOT 1
- After building the application, a crash occurs at the MacOS level when starting the application. HOT 1
- quit button event handle!
- flutter: Warning: Falling back on slow accent color resolution. HOT 2
- MacosWindowScope not available further down tree HOT 1
- Date picker test is not hermetic
- How to solve it HOT 6
- (ResizablePane) Add `onResized` call back HOT 1
- MacosThemeData should implement value equality HOT 1
- how to set TextButtonTheme in MacosApp
- Position of the 'toggle sidebar' button HOT 1
- Add `pubspec.lock` to `.gitignore` HOT 1
- Missing feedback when clicking sidebar button
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macos_ui.