From 78eb4a5990dadb3402dd3e80d04e2cfd7f9dd6fd Mon Sep 17 00:00:00 2001 From: Aceeri Date: Mon, 9 Nov 2015 01:42:54 -0800 Subject: Minimum/maximum dimensions for windows in win32 api --- src/window.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/window.rs') 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] -- cgit v1.2.3