Editor toolbar configuration (#7338)

Adds settings for hiding breadcrumbs and quick action bar from
the editor toolbar. If both elements are hidden, the toolbar disappears
completely.

Example:

```json
"toolbar": {
  "breadcrumbs": true,
  "quick_actions": false
}
```

- It intentionally doesn't hide breadcrumbs in other views (for
instance, in the search result window) because their usage there differ
from the main editor.
- The editor controls how breadcrumbs are displayed in the toolbar, so
implementation differs a bit for breadcrumbs and quick actions bar.

Release Notes:

- Added support for configuring the editor toolbar ([4756](https://github.com/zed-industries/zed/issues/4756))
This commit is contained in:
Andrew Lygin 2024-02-03 23:40:54 +03:00 committed by GitHub
parent 55185c159b
commit 8da6e62914
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 113 additions and 38 deletions

View file

@ -127,7 +127,7 @@ impl Render for Toolbar {
h_flex()
// We're using `flex_none` here to prevent some flickering that can occur when the
// size of the left items container changes.
.flex_none()
.when_else(has_left_items, Div::flex_none, Div::flex_auto)
.justify_end()
.children(self.right_items().map(|item| item.to_any())),
)