diff options
author | 2022-09-23 15:54:09 -0500 | |
---|---|---|
committer | 2022-09-23 15:56:37 -0500 | |
commit | bb9236901718a534079131c0719a7d3eeedd19b5 (patch) | |
tree | f593283cb482f9741dea3500451fedd3a55ea3f2 /examples/system_information | |
parent | 8d2331af01f9d60c8b58d0b58523aae39947632e (diff) | |
download | iced-bb9236901718a534079131c0719a7d3eeedd19b5.tar.gz iced-bb9236901718a534079131c0719a7d3eeedd19b5.tar.bz2 iced-bb9236901718a534079131c0719a7d3eeedd19b5.zip |
Include short version in example app
Diffstat (limited to 'examples/system_information')
-rw-r--r-- | examples/system_information/src/main.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/system_information/src/main.rs b/examples/system_information/src/main.rs index af67742f..175b4387 100644 --- a/examples/system_information/src/main.rs +++ b/examples/system_information/src/main.rs @@ -9,12 +9,14 @@ pub fn main() -> iced::Result { Example::run(Settings::default()) } +#[allow(clippy::large_enum_variant)] enum Example { Loading, Loaded { information: system::Information }, } #[derive(Clone, Debug)] +#[allow(clippy::large_enum_variant)] enum Message { InformationReceived(system::Information), Refresh, @@ -80,6 +82,14 @@ impl Application for Example { .unwrap_or(&"unknown".to_string()) )); + let system_short_version = text(format!( + "System short version: {}", + information + .system_short_version + .as_ref() + .unwrap_or(&"unknown".to_string()) + )); + let cpu_brand = text(format!("Processor brand: {}", information.cpu_brand)); @@ -126,6 +136,7 @@ impl Application for Example { system_name.size(30), system_kernel.size(30), system_version.size(30), + system_short_version.size(30), cpu_brand.size(30), cpu_cores.size(30), memory_total.size(30), |