honor resizable on mac
get rid of todo
oops
didn't really need that else
@@ -121,7 +121,6 @@ impl WindowBuilder {
}
pub fn resizable(&mut self, resizable: bool) {
- // TODO: Use this in `self.build`
self.resizable = resizable;
}
@@ -141,10 +140,14 @@ impl WindowBuilder {
pub fn build(self) -> Result<WindowHandle, Error> {
assert_main_thread();
unsafe {
- let style_mask = NSWindowStyleMask::NSTitledWindowMask
+ let mut style_mask = NSWindowStyleMask::NSTitledWindowMask
| NSWindowStyleMask::NSClosableWindowMask
- | NSWindowStyleMask::NSMiniaturizableWindowMask
- | NSWindowStyleMask::NSResizableWindowMask;
+ | NSWindowStyleMask::NSMiniaturizableWindowMask;
+
+ if self.resizable {
+ style_mask |= NSWindowStyleMask::NSResizableWindowMask;
+ }
+
let rect = NSRect::new(
NSPoint::new(0., 0.),
NSSize::new(self.size.width, self.size.height),
