mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-12 05:31:31 +11:00
Clean up pattern matches
This commit is contained in:
parent
f8f2950afd
commit
1891764afd
|
@ -208,27 +208,25 @@ impl Window {
|
||||||
|
|
||||||
fn create_window(dimensions: (u32, u32), title: &str, monitor: Option<MonitorID>) -> Option<id> {
|
fn create_window(dimensions: (u32, u32), title: &str, monitor: Option<MonitorID>) -> Option<id> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let scr_frame = match monitor {
|
let frame = if monitor.is_some() {
|
||||||
Some(_) => {
|
let screen = NSScreen::mainScreen(nil);
|
||||||
let screen = NSScreen::mainScreen(nil);
|
NSScreen::frame(screen)
|
||||||
NSScreen::frame(screen)
|
} else {
|
||||||
}
|
let (width, height) = dimensions;
|
||||||
None => {
|
NSRect::new(NSPoint::new(0., 0.), NSSize::new(width as f64, height as f64))
|
||||||
let (width, height) = dimensions;
|
|
||||||
NSRect::new(NSPoint::new(0., 0.), NSSize::new(width as f64, height as f64))
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let masks = match monitor {
|
let masks = if monitor.is_some() {
|
||||||
Some(_) => NSBorderlessWindowMask as NSUInteger,
|
NSBorderlessWindowMask as NSUInteger
|
||||||
None => NSTitledWindowMask as NSUInteger |
|
} else {
|
||||||
NSClosableWindowMask as NSUInteger |
|
NSTitledWindowMask as NSUInteger |
|
||||||
NSMiniaturizableWindowMask as NSUInteger |
|
NSClosableWindowMask as NSUInteger |
|
||||||
NSResizableWindowMask as NSUInteger,
|
NSMiniaturizableWindowMask as NSUInteger |
|
||||||
|
NSResizableWindowMask as NSUInteger
|
||||||
};
|
};
|
||||||
|
|
||||||
let window = NSWindow::alloc(nil).initWithContentRect_styleMask_backing_defer_(
|
let window = NSWindow::alloc(nil).initWithContentRect_styleMask_backing_defer_(
|
||||||
scr_frame,
|
frame,
|
||||||
masks,
|
masks,
|
||||||
NSBackingStoreBuffered,
|
NSBackingStoreBuffered,
|
||||||
false,
|
false,
|
||||||
|
|
Loading…
Reference in a new issue