Respect label_color for Buttons (#3469)

This PR makes `Button`s respect the `label_color` that is specified,
provided they are not disabled or selected.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2023-11-30 20:36:59 -05:00
committed by GitHub
parent 0441b4805a
commit 6d62e6c562
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ impl RenderOnce for Button {
} else if self.base.selected {
Color::Selected
} else {
Color::Default
self.label_color.unwrap_or_default()
};
self.base.child(
@@ -14,6 +14,10 @@ impl Render for ButtonStory {
.child(Story::title_for::<Button>())
.child(Story::label("Default"))
.child(Button::new("default_filled", "Click me"))
.child(Story::label("Selected"))
.child(Button::new("selected_filled", "Click me").selected(true))
.child(Story::label("With `label_color`"))
.child(Button::new("filled_with_label_color", "Click me").color(Color::Created))
.child(Story::label("Default (Subtle)"))
.child(Button::new("default_subtle", "Click me").style(ButtonStyle::Subtle))
.child(Story::label("Default (Transparent)"))