# Simplify constructing tab content that is purely textual \(\#14695\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/2c8ead4423af87a6e0f02788fe40ba176e7588b3)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 2c8ead4423af87a6e0f02788fe40ba176e7588b3

Requested commit: 2c8ead4423af87a6e0f02788fe40ba176e7588b3

Commit: 2c8ead4423af87a6e0f02788fe40ba176e7588b3

Tree: 8b45955aba179769b477a79a4570130c8ac09553

Author: Marshall Bowers

Committer: GitHub

## Message

```
Simplify constructing tab content that is purely textual (#14695)

This PR adds a streamlined way to consistently construct tab content for
items that only have textual content in the tabs.

The `Item` trait now has a new `tab_content_text` method that can be
used to return the textual content for the tab.

The `tab_content` method now has a default implementation that—unless
overridden—will construct a `Label` out of the text. This default
implementation also takes care of setting the label color based on the
active state of the tab, something that previously had to be repeated in
each `tab_content` implementation.

The majority of our tabs are now using `tab_content_text`.

Release Notes:

- N/A
```

## Parents

- [ca2976559e6ea732768b8811d4332201a1f272fd](https://git.cafe/gitcafe/zed/commit/ca2976559e6ea732768b8811d4332201a1f272fd?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/2c8ead4423af87a6e0f02788fe40ba176e7588b3?format=markdown)
