Adjust TintColor
color token terminology (#22826)
Previously, to use a green and red shade with `TintColor` you'd need to pass `Positive` and `Negative`, respectively. This terminology always tripped me up, because, for example, I'd often try to use something like: ``` Button::new("icon_color", "Negative") style(ButtonStyle::Tinted(TintColor::Negative)) .color(Color::Error) .icon_color(Color::Error) .icon(IconName::Trash), ) ``` ...and due to `icon_color` taking `Color::Error`, I'd always get `TintColor` wrong at a first try, because I would, out of muscle memory, write `TintColor::Error`, which wouldn't compile. That's exactly the change in this PR—`TintColor` now takes `Success` and `Error` instead of `Positive` and `Negative`, for more consistency. Release Notes: - N/A
This commit is contained in:
parent
bbb473b8df
commit
115aa43354
4 changed files with 18 additions and 18 deletions
|
@ -474,9 +474,9 @@ impl ComponentPreview for Button {
|
|||
.style(ButtonStyle::Tinted(TintColor::Accent)),
|
||||
),
|
||||
single_example(
|
||||
"Negative",
|
||||
Button::new("tinted_negative", "Negative")
|
||||
.style(ButtonStyle::Tinted(TintColor::Negative)),
|
||||
"Error",
|
||||
Button::new("tinted_negative", "Error")
|
||||
.style(ButtonStyle::Tinted(TintColor::Error)),
|
||||
),
|
||||
single_example(
|
||||
"Warning",
|
||||
|
@ -484,9 +484,9 @@ impl ComponentPreview for Button {
|
|||
.style(ButtonStyle::Tinted(TintColor::Warning)),
|
||||
),
|
||||
single_example(
|
||||
"Positive",
|
||||
Button::new("tinted_positive", "Positive")
|
||||
.style(ButtonStyle::Tinted(TintColor::Positive)),
|
||||
"Success",
|
||||
Button::new("tinted_positive", "Success")
|
||||
.style(ButtonStyle::Tinted(TintColor::Success)),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -527,8 +527,8 @@ impl ComponentPreview for Button {
|
|||
),
|
||||
single_example(
|
||||
"Tinted Icons",
|
||||
Button::new("icon_color", "Delete")
|
||||
.style(ButtonStyle::Tinted(TintColor::Negative))
|
||||
Button::new("icon_color", "Error")
|
||||
.style(ButtonStyle::Tinted(TintColor::Error))
|
||||
.color(Color::Error)
|
||||
.icon_color(Color::Error)
|
||||
.icon(IconName::Trash)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue