feat: configurable fonts

This commit is contained in:
Michael Aaron Murphy 2024-10-03 21:27:06 +02:00 committed by Michael Murphy
parent e645dee2f0
commit 9e064e7fa0
20 changed files with 143 additions and 124 deletions

View file

@ -145,10 +145,9 @@ impl<'a, Message: Clone + 'static> From<Button<'a, Message>> for Element<'a, Mes
crate::widget::text(builder.label)
.size(builder.font_size)
.line_height(LineHeight::Absolute(builder.line_height.into()))
.font({
let mut font = crate::font::DEFAULT;
font.weight = builder.font_weight;
font
.font(crate::font::Font {
weight: builder.font_weight,
..crate::font::default()
})
.into(),
);
@ -182,10 +181,9 @@ impl<'a, Message: Clone + 'static> From<Button<'a, Message>> for Element<'a, Mes
} else {
tooltip(button, builder.tooltip, tooltip::Position::Top)
.size(builder.font_size)
.font({
let mut font = crate::font::DEFAULT;
font.weight = builder.font_weight;
font
.font(crate::font::Font {
weight: builder.font_weight,
..crate::font::default()
})
.into()
}