Use Program API in todos example
This commit is contained in:
parent
80b544e548
commit
784fa80c0d
3 changed files with 46 additions and 42 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue