diff options
| author | 2024-03-17 17:57:24 +0100 | |
|---|---|---|
| committer | 2024-03-17 17:57:24 +0100 | |
| commit | 784fa80c0d92a7d1fda8a7ff77185d50423e228a (patch) | |
| tree | f965e9ffa7a57311cb8fa00113490cdb249b3a25 /src | |
| parent | 80b544e5486d058c439b7d499b18fef2a75317b2 (diff) | |
| download | iced-784fa80c0d92a7d1fda8a7ff77185d50423e228a.tar.gz iced-784fa80c0d92a7d1fda8a7ff77185d50423e228a.tar.bz2 iced-784fa80c0d92a7d1fda8a7ff77185d50423e228a.zip | |
Use `Program` API in `todos` example
Diffstat (limited to '')
| -rw-r--r-- | src/application/program.rs | 16 | 
1 files changed, 15 insertions, 1 deletions
| diff --git a/src/application/program.rs b/src/application/program.rs index d70f39cf..2e77678e 100644 --- a/src/application/program.rs +++ b/src/application/program.rs @@ -32,7 +32,7 @@  use crate::application::{self, Application};  use crate::executor::{self, Executor};  use crate::window; -use crate::{Command, Element, Font, Result, Settings, Subscription}; +use crate::{Command, Element, Font, Result, Settings, Size, Subscription};  use std::borrow::Cow; @@ -277,6 +277,20 @@ impl<P: Definition> Program<P> {          }      } +    /// Sets the [`window::Settings::size`] of the [`Program`]. +    pub fn window_size(self, size: impl Into<Size>) -> Self { +        Self { +            settings: Settings { +                window: window::Settings { +                    size: size.into(), +                    ..self.settings.window +                }, +                ..self.settings +            }, +            ..self +        } +    } +      /// Sets the [`window::Settings::transparent`] of the [`Program`].      pub fn transparent(self, transparent: bool) -> Self {          Self { | 
