summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/application/program.rs16
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 {