Files
oak-gpui/crates
e5f05a21ce settings ui: Improve numeric stepper component interface (#36513)
This is the first step to allowing users to type into a numeric stepper
to set its value. This PR makes the numeric stepper take in a generic
type `T` where T: `NumericStepperType`

```rust
pub trait NumericStepperType:
    Display
    + Add<Output = Self>
    + Sub<Output = Self>
    + Copy
    + Clone
    + Sized
    + PartialOrd
    + FromStr
    + 'static
{
    fn default_format(value: &Self) -> String {
        format!("{}", value)
    }
    fn default_step() -> Self;
    fn large_step() -> Self;
    fn small_step() -> Self;
    fn min_value() -> Self;
    fn max_value() -> Self;
}
```

This allows setting of step sizes and min/max values as well as making
the component easier to use.

cc @danilo-leal 

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>
2025-10-03 17:35:30 +00:00
..
2025-09-08 21:53:17 -06:00
2025-09-25 14:42:32 -07:00
2025-09-03 22:10:14 +00:00
2025-09-26 11:41:26 -04:00
2025-10-02 03:52:06 +00:00
2025-09-25 14:42:32 -07:00
2025-09-18 16:47:23 +00:00
2025-09-26 11:41:26 -04:00
2025-09-24 02:19:52 -06:00
2025-09-18 16:47:23 +00:00
2025-09-18 16:47:23 +00:00
2025-09-25 14:42:32 -07:00
2025-09-08 21:53:17 -06:00
2025-09-22 14:36:10 -07:00
2025-09-18 16:47:23 +00:00
2025-09-29 21:16:00 +00:00
2025-09-26 11:41:26 -04:00