diff options
-rw-r--r-- | examples/pokedex/src/main.rs | 1 | ||||
-rw-r--r-- | web/src/widget/text.rs | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/examples/pokedex/src/main.rs b/examples/pokedex/src/main.rs index b0cb3c55..4449b901 100644 --- a/examples/pokedex/src/main.rs +++ b/examples/pokedex/src/main.rs @@ -79,6 +79,7 @@ impl Application for Pokedex { fn view(&mut self) -> Element<Message> { let content = match self { Pokedex::Loading => Column::new() + .width(Length::Shrink) .push(Text::new("Searching for Pokémon...").size(40)), Pokedex::Loaded { pokemon, search } => Column::new() .max_width(500) diff --git a/web/src/widget/text.rs b/web/src/widget/text.rs index 46230fef..3ec565a8 100644 --- a/web/src/widget/text.rs +++ b/web/src/widget/text.rs @@ -133,12 +133,16 @@ impl<'a, Message> Widget<Message> for Text { let style = bumpalo::format!( in bump, - "width: {}; height: {}; font-size: {}px; color: {}; text-align: {}", + "width: {}; height: {}; font-size: {}px; color: {}; text-align: {}; font-family: {}", width, height, self.size.unwrap_or(20), color, - text_align + text_align, + match self.font { + Font::Default => "inherit", + Font::External { name, .. } => name, + } ); // TODO: Complete styling |