Add function helper in iced_winit::system
This commit is contained in:
parent
c2f45a192f
commit
0b36a55196
2 changed files with 15 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ pub mod application;
|
||||||
pub mod clipboard;
|
pub mod clipboard;
|
||||||
pub mod conversion;
|
pub mod conversion;
|
||||||
pub mod settings;
|
pub mod settings;
|
||||||
|
pub mod system;
|
||||||
pub mod window;
|
pub mod window;
|
||||||
|
|
||||||
mod error;
|
mod error;
|
||||||
|
|
|
||||||
14
winit/src/system.rs
Normal file
14
winit/src/system.rs
Normal file
|
|
@ -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),
|
||||||
|
)))
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue