settings ui: Add numeric steppers to settings UI (#39491)
This PR adds the numeric stepper component to the settings ui and
implements some settings that rely on this component as well.
I also switched {buffer/ui}_font_weight to the `gpui::FontWeight` type
and added a manual implementation of the Schemars trait. This allows Zed
to send min, max, and default information to the JSON LSP when a user is
manually editing the settings file.
The numeric stepper elements added to the settings ui are below:
- ui font size
- ui font weight
- Buffer font size
- Buffer font weight
- Scroll sensitivity
- Fast scroll sensitivity
- Vertical scroll margin
- Horizontal scroll margin
- Inline blame padding
- Inline blame delay
- Inline blame min column
- Unnecessary code fade
- Tab Size
- Hover popover delay
Release Notes:
- N/A
This commit is contained in:
@@ -125,6 +125,12 @@ impl VsCodeSettings {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_f32_setting<T: From<f32>>(&self, key: &str, setting: &mut Option<T>) {
|
||||
if let Some(s) = self.content.get(key).and_then(Value::as_f64) {
|
||||
*setting = Some(T::from(s as f32))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn enum_setting<T>(
|
||||
&self,
|
||||
key: &str,
|
||||
|
||||
Reference in New Issue
Block a user