From 0b36a55196300371343a1614cec61ac041f160f4 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 10 Mar 2022 01:56:25 -0300 Subject: Add function helper in `iced_winit::system` --- winit/src/system.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 winit/src/system.rs (limited to 'winit/src/system.rs') 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( + f: impl Fn(Option) -> Message + 'static, +) -> Command { + Command::single(command::Action::System(system::Action::QueryInformation( + Box::new(f), + ))) +} -- cgit