diff options
author | 2022-03-10 01:56:25 -0300 | |
---|---|---|
committer | 2022-04-26 18:55:51 -0300 | |
commit | 0b36a55196300371343a1614cec61ac041f160f4 (patch) | |
tree | 38db223d14787641e636fec568b925001e5c40f5 | |
parent | c2f45a192fdeba5eec79158dda8640a99a36fdb1 (diff) | |
download | iced-0b36a55196300371343a1614cec61ac041f160f4.tar.gz iced-0b36a55196300371343a1614cec61ac041f160f4.tar.bz2 iced-0b36a55196300371343a1614cec61ac041f160f4.zip |
Add function helper in `iced_winit::system`
-rw-r--r-- | winit/src/lib.rs | 1 | ||||
-rw-r--r-- | winit/src/system.rs | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/winit/src/lib.rs b/winit/src/lib.rs index b31adf6e..2b5bb2ff 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -31,6 +31,7 @@ pub mod application; pub mod clipboard; pub mod conversion; pub mod settings; +pub mod system; pub mod window; mod error; diff --git a/winit/src/system.rs b/winit/src/system.rs new file mode 100644 index 00000000..cd3ba075 --- /dev/null +++ b/winit/src/system.rs @@ -0,0 +1,14 @@ +//! Access the native system. +use crate::command::{self, Command}; +use iced_native::system; + +/// Query for available system information. +/// +/// Returns `None` if not using the `sysinfo` feature flag. +pub fn information<Message>( + f: impl Fn(Option<system::Information>) -> Message + 'static, +) -> Command<Message> { + Command::single(command::Action::System(system::Action::QueryInformation( + Box::new(f), + ))) +} |