Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

settings_ui: Title Case Enums (#39711)

Ben Kunkleb8a6180b82e6
diff --git a/Cargo.lock b/Cargo.lock
index f5102607322..ada56e87e59 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -14370,6 +14370,7 @@ dependencies = [
"futures 0.3.31",
"fuzzy",
"gpui",
+ "heck 0.5.0",
"language",
"menu",
"node_runtime",
diff --git a/crates/settings_ui/Cargo.toml b/crates/settings_ui/Cargo.toml
index c2cb1ce62b3..0b456d0cb11 100644
--- a/crates/settings_ui/Cargo.toml
+++ b/crates/settings_ui/Cargo.toml
@@ -18,6 +18,7 @@ test-support = []
[dependencies]
anyhow.workspace = true
command_palette_hooks.workspace = true
+heck.workspace = true
editor.workspace = true
feature_flags.workspace = true
fs.workspace = true
diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs
index dd5d953c049..6bb35d53a28 100644
--- a/crates/settings_ui/src/settings_ui.rs
+++ b/crates/settings_ui/src/settings_ui.rs
@@ -11,6 +11,7 @@ use gpui::{
ScrollHandle, Task, TitlebarOptions, UniformListScrollHandle, Window, WindowHandle,
WindowOptions, actions, div, point, prelude::*, px, size, uniform_list,
};
+use heck::ToTitleCase as _;
use project::WorktreeId;
use schemars::JsonSchema;
use serde::Deserialize;
@@ -1639,12 +1640,12 @@ where
DropdownMenu::new(
"dropdown",
- current_value_label,
+ current_value_label.to_title_case(),
ContextMenu::build(window, cx, move |mut menu, _, _| {
for (&value, &label) in std::iter::zip(variants(), labels()) {
let file = file.clone();
menu = menu.toggleable_entry(
- label,
+ label.to_title_case(),
value == current_value,
IconPosition::Start,
None,