@end
-static CGFloat const AtomWindowCornerRadius = 5.0;
+static CGFloat const AtomWindowCornerRadius = 4.0;
@interface AtomNSWindow : AtomEventProcessingWindow {
@protected
@end
-@interface AtomFramelessView : NSView
-@end
-
-@implementation AtomFramelessView
-- (void)drawRect:(NSRect) rect {
- NSBezierPath * shadowPath = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect([self bounds], 0.5, 0.5)
- xRadius:AtomWindowCornerRadius
- yRadius:AtomWindowCornerRadius];
-
- [[NSColor blackColor] set];
- [shadowPath fill];
- [shadowPath addClip];
-}
-@end
-
@interface AtomFramelessNSWindow : AtomNSWindow
- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view;
@end
return YES;
}
+- (BOOL)canBecomeMainWindow {
+ return YES;
+}
+
- (BOOL)hasShadow {
return YES;
}
NSRect main_screen_rect = [[[NSScreen screens] objectAtIndex:0] frame];
NSRect cocoa_bounds = NSMakeRect(
- (NSWidth(main_screen_rect) - width) / 2,
- (NSHeight(main_screen_rect) - height) / 2,
+ round((NSWidth(main_screen_rect) - width) / 2) ,
+ round((NSHeight(main_screen_rect) - height) / 2),
width,
height);
} else {
atomWindow = [[AtomFramelessNSWindow alloc]
initWithContentRect:cocoa_bounds
- styleMask:NSBorderlessWindowMask | NSClosableWindowMask |
+ styleMask:NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask
backing:NSBackingStoreBuffered
defer:YES];
} else {
NSView* frameView = [[window() contentView] superview];
- AtomFramelessView * shadowView = [[AtomFramelessView alloc] initWithFrame: [frameView bounds]];
- [shadowView setAutoresizesSubviews:YES];
- [shadowView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
-
- [view setFrame:[shadowView bounds]];
- [frameView addSubview:shadowView];
- [shadowView addSubview:view];
+ [view setFrame:[frameView bounds]];
+ [frameView addSubview:view];
ClipWebView();
- //
- // [window() setHasShadow: NO];
- // [window() setHasShadow: YES];
[[window() standardWindowButton:NSWindowZoomButton] setHidden:YES];
[[window() standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];