# settings_ui: Handle enums with fields \(\#37945\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2ce0641fe073f56cdbd27c6496032a985b9036ec

Requested commit: 2ce0641fe073f56cdbd27c6496032a985b9036ec

Commit: 2ce0641fe073f56cdbd27c6496032a985b9036ec

Tree: 998a079bab1ce25606367d374a3887c7a3aeb2fe

Author: Ben Kunkle

Committer: GitHub

## Message

```
settings_ui: Handle enums with fields (#37945)

Closes #ISSUE

Adds handling for Enums with fields (i.e. not `enum Foo { Yes, No }`) in
Settings UI. Accomplished by creating default values for each element
with fields (in the derive macro), and rendering a toggle button group
with a button for each variant where switching the active variant sets
the value in the settings JSON to the default for the new active
variant.

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Conrad <conrad@zed.dev>
```

## Parents

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

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