Contents

windowToolbarFullScreenVisibility(_:)

Configures the visibility of the window toolbar when the window enters full screen mode.

Declaration

nonisolated func windowToolbarFullScreenVisibility(_ visibility: WindowToolbarFullScreenVisibility) -> some View

Parameters

  • visibility:

    The visibility to use for the window toolbar in full screen mode.

Discussion

By default, the window toolbar will show at the top of the display, above the window’s contents.

You can use this modifier to override the default behavior.

For example, you can specify that the window toolbar should be hidden by default, and only show once the mouse moves into the area occupied by the menu bar:

struct RootView: View {
    var body: some View {
        ContentView()
            .toolbar {
                ...
            }
            .windowToolbarFullScreenVisibility(.onHover)
    }
}

See Also

Configuring window visibility