fix(widget): allow None for button text color to inherit from container
This commit is contained in:
parent
6acdba28aa
commit
b404497e76
5 changed files with 15 additions and 28 deletions
|
|
@ -124,11 +124,6 @@ impl<'a, Message> Button<'a, Message> {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn inherit_colors(mut self) -> Self {
|
||||
self.style = Style::IconInheritColors;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn vertical(mut self, vertical: bool) -> Self {
|
||||
self.variant.vertical = vertical;
|
||||
self.style = Style::IconVertical;
|
||||
|
|
|
|||
|
|
@ -23,9 +23,6 @@ pub struct Appearance {
|
|||
/// The border [`Color`] of the button.
|
||||
pub border_color: Color,
|
||||
|
||||
/// Opacity of the button.
|
||||
pub opacity: f32,
|
||||
|
||||
/// An outline placed around the border.
|
||||
pub outline_width: f32,
|
||||
|
||||
|
|
@ -36,7 +33,7 @@ pub struct Appearance {
|
|||
pub icon_color: Option<Color>,
|
||||
|
||||
/// The text [`Color`] of the button.
|
||||
pub text_color: Color,
|
||||
pub text_color: Option<Color>,
|
||||
}
|
||||
|
||||
impl Appearance {
|
||||
|
|
@ -48,11 +45,10 @@ impl Appearance {
|
|||
border_radius: BorderRadius::from(0.0),
|
||||
border_width: 0.0,
|
||||
border_color: Color::TRANSPARENT,
|
||||
opacity: 1.0,
|
||||
outline_width: 0.0,
|
||||
outline_color: Color::TRANSPARENT,
|
||||
icon_color: None,
|
||||
text_color: Color::BLACK,
|
||||
text_color: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ where
|
|||
theme,
|
||||
&renderer::Style {
|
||||
icon_color: styling.icon_color.unwrap_or(renderer_style.icon_color),
|
||||
text_color: styling.text_color,
|
||||
text_color: styling.text_color.unwrap_or(renderer_style.icon_color),
|
||||
scale_factor: renderer_style.scale_factor,
|
||||
},
|
||||
content_layout,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue