# settings ui: Improve numeric stepper component interface \(\#36513\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e5f05a21ce1d8a150551d39e3502ef6472856df6

Requested commit: e5f05a21ce1d8a150551d39e3502ef6472856df6

Commit: e5f05a21ce1d8a150551d39e3502ef6472856df6

Tree: 304cbd2f3042bf5f308bbb54247349e0432070ac

Author: Anthony Eid

Committer: GitHub

## Message

````
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>
````

## Parents

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

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