diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-12-05 18:01:55 +0100 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-12-05 18:01:55 +0100 |
commit | 48a02a0c8c9029543360884f1daaaade5d3f11a5 (patch) | |
tree | 0489869b1f75bbd9571e01c39a2d35427c984102 /src/window.rs | |
parent | 8c3ffd2a4fe2dbb0033c1f830d384c0c2d8c88a1 (diff) | |
parent | 2be3c142f0778a3588982572a997dc669adca2a6 (diff) | |
download | glutin-48a02a0c8c9029543360884f1daaaade5d3f11a5.tar.gz glutin-48a02a0c8c9029543360884f1daaaade5d3f11a5.zip |
Merge pull request #659 from Aceeri/minmaxwindow
Minimum/maximum dimensions for windows in win32 API
Diffstat (limited to 'src/window.rs')
-rw-r--r-- | src/window.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/window.rs b/src/window.rs index 86322bd..f2d6580 100644 --- a/src/window.rs +++ b/src/window.rs @@ -52,6 +52,24 @@ impl<'a> WindowBuilder<'a> { self.window.dimensions = Some((width, height)); self } + + /// Sets a minimum dimension size for the window + /// + /// Width and height are in pixels. + #[inline] + pub fn with_min_dimensions(mut self, width: u32, height: u32) -> WindowBuilder<'a> { + self.window.min_dimensions = Some((width, height)); + self + } + + /// Sets a maximum dimension size for the window + /// + /// Width and height are in pixels. + #[inline] + pub fn with_max_dimensions(mut self, width: u32, height: u32) -> WindowBuilder<'a> { + self.window.max_dimensions = Some((width, height)); + self + } /// Requests a specific title for the window. #[inline] |