diff options
author | 2022-08-06 00:32:57 +0200 | |
---|---|---|
committer | 2022-08-06 00:32:57 +0200 | |
commit | 1923dbf7f0769d55e5283f572fde0ce752e28b86 (patch) | |
tree | 7be9b36f941f6e13ddc8884f715c04555b1e77db /examples/url_handler/src | |
parent | 1b4f38c71f6e05e26599ee75ea9c91dde96e71ae (diff) | |
parent | c23ed7e4a0a2b62a0d7cabe6e35d7323eac543d2 (diff) | |
download | iced-1923dbf7f0769d55e5283f572fde0ce752e28b86.tar.gz iced-1923dbf7f0769d55e5283f572fde0ce752e28b86.tar.bz2 iced-1923dbf7f0769d55e5283f572fde0ce752e28b86.zip |
Merge pull request #1393 from iced-rs/deprecate-stateful-widgets
Replace stateful widgets with the new `iced_pure` API
Diffstat (limited to 'examples/url_handler/src')
-rw-r--r-- | examples/url_handler/src/main.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/url_handler/src/main.rs b/examples/url_handler/src/main.rs index 3695b6b7..3257b519 100644 --- a/examples/url_handler/src/main.rs +++ b/examples/url_handler/src/main.rs @@ -1,7 +1,7 @@ use iced::executor; +use iced::widget::{container, text}; use iced::{ - Application, Command, Container, Element, Length, Settings, Subscription, - Text, Theme, + Application, Command, Element, Length, Settings, Subscription, Theme, }; use iced_native::{ event::{MacOS, PlatformSpecific}, @@ -55,13 +55,13 @@ impl Application for App { iced_native::subscription::events().map(Message::EventOccurred) } - fn view(&mut self) -> Element<Message> { + fn view(&self) -> Element<Message> { let content = match &self.url { - Some(url) => Text::new(url), - None => Text::new("No URL received yet!"), + Some(url) => text(url), + None => text("No URL received yet!"), }; - Container::new(content.size(48)) + container(content.size(48)) .width(Length::Fill) .height(Length::Fill) .center_x() |