From 96a462d2f2cb608ad14c93cc55896108a2dccb2b Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 9 Jun 2021 15:00:01 -0300 Subject: Use new enum variant and new winit repo --- examples/url_handler/src/main.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'examples/url_handler/src') diff --git a/examples/url_handler/src/main.rs b/examples/url_handler/src/main.rs index 56d81031..f14e5227 100644 --- a/examples/url_handler/src/main.rs +++ b/examples/url_handler/src/main.rs @@ -1,8 +1,11 @@ use iced::{ - executor, Application, Command, Clipboard, - Container, Element, Length, Settings, Subscription, Text, + executor, Application, Clipboard, Command, Container, Element, Length, + Settings, Subscription, Text, +}; +use iced_native::{ + event::{MacOS, PlatformSpecific}, + Event, }; -use iced_native::Event; pub fn main() -> iced::Result { App::run(Settings::default()) @@ -38,7 +41,10 @@ impl Application for App { ) -> Command { match message { Message::EventOccurred(event) => { - if let Event::UrlReceived(url) = event{ + if let Event::PlatformSpecific(PlatformSpecific::MacOS( + MacOS::ReceivedUrl(url), + )) = event + { self.url = Some(url); } } @@ -52,9 +58,9 @@ impl Application for App { } fn view(&mut self) -> Element { - let content = match &self.url{ + let content = match &self.url { Some(url) => Text::new(format!("{}", url)), - None => Text::new("No URL received yet!") + None => Text::new("No URL received yet!"), }; Container::new(content.size(48)) -- cgit