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>
52 lines
1.1 KiB
TOML
52 lines
1.1 KiB
TOML
[package]
|
|
name = "onboarding"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/onboarding.rs"
|
|
|
|
[features]
|
|
default = []
|
|
|
|
[dependencies]
|
|
ai_onboarding.workspace = true
|
|
anyhow.workspace = true
|
|
client.workspace = true
|
|
component.workspace = true
|
|
db.workspace = true
|
|
documented.workspace = true
|
|
editor.workspace = true
|
|
fs.workspace = true
|
|
fuzzy.workspace = true
|
|
git.workspace = true
|
|
gpui.workspace = true
|
|
itertools.workspace = true
|
|
language.workspace = true
|
|
language_model.workspace = true
|
|
menu.workspace = true
|
|
notifications.workspace = true
|
|
picker.workspace = true
|
|
project.workspace = true
|
|
schemars.workspace = true
|
|
serde.workspace = true
|
|
settings.workspace = true
|
|
telemetry.workspace = true
|
|
theme.workspace = true
|
|
ui.workspace = true
|
|
ui_input.workspace = true
|
|
util.workspace = true
|
|
vim_mode_setting.workspace = true
|
|
workspace-hack.workspace = true
|
|
workspace.workspace = true
|
|
zed_actions.workspace = true
|
|
zlog.workspace = true
|
|
|
|
[dev-dependencies]
|
|
db = {workspace = true, features = ["test-support"]}
|