diff options
| -rw-r--r-- | examples/rich/src/main.rs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/examples/rich/src/main.rs b/examples/rich/src/main.rs index 9ee2ea9..7cb3245 100644 --- a/examples/rich/src/main.rs +++ b/examples/rich/src/main.rs @@ -3,7 +3,9 @@ use iced::{Center, Element, Fill, Font, color, font, padding}; use iced_selection::{rich_text, span}; fn main() -> iced::Result { - iced::run(State::update, State::view) + iced::application(State::default, State::update, State::view) + .theme(iced::Theme::Dark) + .run() } #[derive(Default)] @@ -45,7 +47,7 @@ impl State { span("Rust") .color(color!(0x2b79a2)) .link("https://rust-lang.org"), - ".\nIt is inspired by ", + ". It is inspired by ", span("Elm") .color(color!(0x2b79a2)) .link("https://elm-lang.org"), @@ -55,12 +57,30 @@ impl State { .color(color!(0x2b79a2)) .link("https://en.wikipedia.org/wiki/Graphical_user_interface") .font(Font { - style:font::Style::Italic, + style: font::Style::Italic, ..Font::DEFAULT }), - " for your Rust applications." + " for your Rust applications.\n\n", + "iced is strongly focused on ", + span("simplicity") + .font(Font { + weight: font::Weight::Bold, + ..Font::DEFAULT + }), + " and ", + span("type-safety") + .font(Font { + weight: font::Weight::Bold, + ..Font::DEFAULT + }), + ". As a result, iced tries to provide simple building blocks that can be put together with strong typing to reduce the chance of ", + span("runtime errors") + .font(Font { + weight: font::Weight::Bold, + ..Font::DEFAULT + }), + "." ] - .align_x(Center) .on_link_click(Message::LinkClicked) .on_link_hover(Message::LinkHovered) .on_hover_lost(Message::HoverLost), |
