settings ui: Add missing setting elements (#39644)
Added the following settings to the UI Editor Page - Scrollbar Section (9 settings) - Show - Cursors - Git Diff - Search Results - Selected Text - Selected Symbol - Diagnostics - Horizontal Scrollbar - Vertical Scrollbar Editor Page - Minimap Section (6 settings) - Show - Display In - Thumb - Thumb Border - Current Line Highlight - Max Width Columns Editor Page - Editor Behavior Section (3 settings) - Expand Excerpt Lines - Excerpt Context Lines - Minimum Contrast For Highlights Debugger Page (7 settings) - Stepping Granularity - Save Breakpoints - Timeout - Dock - Log DAP Communications - Format DAP Log Messages - Button Panels Page - Git Panel Section (3 settings) - Button - Dock - Default Width Collaboration Page - Experimental Section (4 settings) - Auto Microphone Volume - Auto Speaker Volume - Denoise - Legacy Audio Compatible Release Notes: - N/A
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::{
|
||||
fmt::Display,
|
||||
num::{NonZeroU32, NonZeroU64},
|
||||
num::{NonZero, NonZeroU32, NonZeroU64},
|
||||
rc::Rc,
|
||||
str::FromStr,
|
||||
};
|
||||
@@ -8,7 +8,7 @@ use std::{
|
||||
use editor::{Editor, EditorStyle};
|
||||
use gpui::{ClickEvent, Entity, FocusHandle, Focusable, FontWeight, Modifiers};
|
||||
|
||||
use settings::CodeFade;
|
||||
use settings::{CodeFade, MinimumContrast};
|
||||
use ui::{IconButtonShape, prelude::*};
|
||||
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
@@ -88,6 +88,30 @@ impl NumericStepperType for settings::CodeFade {
|
||||
}
|
||||
}
|
||||
|
||||
impl NumericStepperType for settings::MinimumContrast {
|
||||
fn default_step() -> Self {
|
||||
MinimumContrast(1.0)
|
||||
}
|
||||
fn large_step() -> Self {
|
||||
MinimumContrast(10.0)
|
||||
}
|
||||
fn small_step() -> Self {
|
||||
MinimumContrast(0.5)
|
||||
}
|
||||
fn min_value() -> Self {
|
||||
MinimumContrast(0.0)
|
||||
}
|
||||
fn max_value() -> Self {
|
||||
MinimumContrast(106.0)
|
||||
}
|
||||
fn saturating_add(self, rhs: Self) -> Self {
|
||||
MinimumContrast((self.0 + rhs.0).min(Self::max_value().0))
|
||||
}
|
||||
fn saturating_sub(self, rhs: Self) -> Self {
|
||||
MinimumContrast((self.0 - rhs.0).max(Self::min_value().0))
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! impl_numeric_stepper_int {
|
||||
($type:ident) => {
|
||||
impl NumericStepperType for $type {
|
||||
@@ -207,6 +231,7 @@ impl_numeric_stepper_int!(u64);
|
||||
|
||||
impl_numeric_stepper_nonzero_int!(NonZeroU32, u32);
|
||||
impl_numeric_stepper_nonzero_int!(NonZeroU64, u64);
|
||||
impl_numeric_stepper_nonzero_int!(NonZero<usize>, usize);
|
||||
|
||||
#[derive(RegisterComponent)]
|
||||
pub struct NumericStepper<T = usize> {
|
||||
|
||||
Reference in New Issue
Block a user