Add font-family to Text style in iced_web
This commit is contained in:
parent
ad500441af
commit
f719ba3f4e
2 changed files with 7 additions and 2 deletions
|
|
@ -79,6 +79,7 @@ impl Application for Pokedex {
|
||||||
fn view(&mut self) -> Element<Message> {
|
fn view(&mut self) -> Element<Message> {
|
||||||
let content = match self {
|
let content = match self {
|
||||||
Pokedex::Loading => Column::new()
|
Pokedex::Loading => Column::new()
|
||||||
|
.width(Length::Shrink)
|
||||||
.push(Text::new("Searching for Pokémon...").size(40)),
|
.push(Text::new("Searching for Pokémon...").size(40)),
|
||||||
Pokedex::Loaded { pokemon, search } => Column::new()
|
Pokedex::Loaded { pokemon, search } => Column::new()
|
||||||
.max_width(500)
|
.max_width(500)
|
||||||
|
|
|
||||||
|
|
@ -133,12 +133,16 @@ impl<'a, Message> Widget<Message> for Text {
|
||||||
|
|
||||||
let style = bumpalo::format!(
|
let style = bumpalo::format!(
|
||||||
in bump,
|
in bump,
|
||||||
"width: {}; height: {}; font-size: {}px; color: {}; text-align: {}",
|
"width: {}; height: {}; font-size: {}px; color: {}; text-align: {}; font-family: {}",
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
self.size.unwrap_or(20),
|
self.size.unwrap_or(20),
|
||||||
color,
|
color,
|
||||||
text_align
|
text_align,
|
||||||
|
match self.font {
|
||||||
|
Font::Default => "inherit",
|
||||||
|
Font::External { name, .. } => name,
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Complete styling
|
// TODO: Complete styling
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue