Use new enum variant and new winit repo

This commit is contained in:
Richard 2021-06-09 15:00:01 -03:00 committed by Héctor Ramón Jiménez
parent 9ae22b58d8
commit 96a462d2f2
No known key found for this signature in database
GPG key ID: 44B88EB52AB1EE8D
6 changed files with 41 additions and 18 deletions

View file

@ -7,6 +7,4 @@ publish = false
[dependencies]
iced = { path = "../.." }
iced_native = { path = "../../native" }
syslog="4.0"
log="0.4"
iced_native = { path = "../../native" }

View file

@ -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<Message> {
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<Message> {
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))