gui: use patch for iced_futures

close #684
This commit is contained in:
edouard 2023-09-02 15:15:56 +02:00
parent 29b20972c5
commit df849ba960
3 changed files with 11 additions and 13 deletions

3
gui/Cargo.lock generated
View File

@ -1750,8 +1750,7 @@ dependencies = [
[[package]]
name = "iced_futures"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "215d51fa4f70dbb63775d7141243c4d98d4d525d8949695601f8fbac7dcbc04e"
source = "git+https://github.com/edouardparis/iced?branch=fix-futures-recipe#2d8318b13bdf8aaf31bc6d5a72b22313ed2d10cf"
dependencies = [
"futures",
"log",

View File

@ -47,6 +47,9 @@ bitcoin_hashes = "0.12"
reqwest = { version = "0.11", default-features=false, features = ["rustls-tls"] }
rust-ini = "0.19.0"
[patch.crates-io]
iced_futures = { git = "https://github.com/edouardparis/iced", branch = "fix-futures-recipe"}
[target.'cfg(windows)'.dependencies]
zip = { version = "0.6", default-features=false, features = ["bzip2", "deflate"] }

View File

@ -259,18 +259,14 @@ impl Application for GUI {
State::App(v) => v.subscription().map(|msg| Message::Run(Box::new(msg))),
State::Launcher(v) => v.subscription().map(|msg| Message::Launch(Box::new(msg))),
},
iced_native::subscription::events_with(|event, _status| {
if matches!(
event,
iced::Event::Window(iced_native::window::Event::CloseRequested)
) {
Some(event)
} else {
None
}
})
.map(Self::Message::Event),
iced_native::subscription::events().map(Self::Message::Event),
])
.with_filter(|(event, _status)| {
matches!(
event,
iced::Event::Window(iced_native::window::Event::CloseRequested)
)
})
}
fn view(&self) -> Element<Self::Message> {