fix(segmented_button): update text on font changes
This commit is contained in:
parent
c6589e0165
commit
9f11239ea5
1 changed files with 3 additions and 1 deletions
|
|
@ -620,8 +620,10 @@ where
|
||||||
(self.font_inactive, 2)
|
(self.font_inactive, 2)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let font = font.unwrap_or_else(crate::font::default);
|
||||||
let mut hasher = DefaultHasher::new();
|
let mut hasher = DefaultHasher::new();
|
||||||
text.hash(&mut hasher);
|
text.hash(&mut hasher);
|
||||||
|
font.hash(&mut hasher);
|
||||||
button_state.hash(&mut hasher);
|
button_state.hash(&mut hasher);
|
||||||
let text_hash = hasher.finish();
|
let text_hash = hasher.finish();
|
||||||
|
|
||||||
|
|
@ -635,7 +637,7 @@ where
|
||||||
content: text,
|
content: text,
|
||||||
size: iced::Pixels(self.font_size),
|
size: iced::Pixels(self.font_size),
|
||||||
bounds: Size::INFINITY,
|
bounds: Size::INFINITY,
|
||||||
font: font.unwrap_or_else(crate::font::default),
|
font,
|
||||||
horizontal_alignment: alignment::Horizontal::Left,
|
horizontal_alignment: alignment::Horizontal::Left,
|
||||||
vertical_alignment: alignment::Vertical::Center,
|
vertical_alignment: alignment::Vertical::Center,
|
||||||
shaping: Shaping::Advanced,
|
shaping: Shaping::Advanced,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue