From 9f11239ea56b76c3f6558d1f9d4df0b295cd5c51 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Thu, 10 Oct 2024 18:52:18 +0200 Subject: [PATCH] fix(segmented_button): update text on font changes --- src/widget/segmented_button/widget.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widget/segmented_button/widget.rs b/src/widget/segmented_button/widget.rs index 3091c6b3..fc0b39cc 100644 --- a/src/widget/segmented_button/widget.rs +++ b/src/widget/segmented_button/widget.rs @@ -620,8 +620,10 @@ where (self.font_inactive, 2) }; + let font = font.unwrap_or_else(crate::font::default); let mut hasher = DefaultHasher::new(); text.hash(&mut hasher); + font.hash(&mut hasher); button_state.hash(&mut hasher); let text_hash = hasher.finish(); @@ -635,7 +637,7 @@ where content: text, size: iced::Pixels(self.font_size), bounds: Size::INFINITY, - font: font.unwrap_or_else(crate::font::default), + font, horizontal_alignment: alignment::Horizontal::Left, vertical_alignment: alignment::Vertical::Center, shaping: Shaping::Advanced,