Skip the whole AtomFramelessWindow.
Just round the web view and set the bounds to the window, not the main view.
This commit is contained in:
parent
7a1365673e
commit
7a21ae831f
1 changed files with 8 additions and 32 deletions
|
@ -100,20 +100,6 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface AtomFramelessNSWindow : AtomNSWindow
|
|
||||||
- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation AtomFramelessNSWindow
|
|
||||||
|
|
||||||
- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view {
|
|
||||||
[[NSBezierPath bezierPathWithRect:rect] addClip];
|
|
||||||
[[NSColor clearColor] set];
|
|
||||||
NSRectFill(rect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface ControlRegionView : NSView {
|
@interface ControlRegionView : NSView {
|
||||||
@private
|
@private
|
||||||
atom::NativeWindowMac* shellWindow_; // Weak; owns self.
|
atom::NativeWindowMac* shellWindow_; // Weak; owns self.
|
||||||
|
@ -168,24 +154,14 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents,
|
||||||
height);
|
height);
|
||||||
|
|
||||||
AtomNSWindow* atomWindow;
|
AtomNSWindow* atomWindow;
|
||||||
NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask |
|
|
||||||
NSMiniaturizableWindowMask | NSResizableWindowMask |
|
atomWindow = [[AtomNSWindow alloc]
|
||||||
NSTexturedBackgroundWindowMask;
|
initWithContentRect:cocoa_bounds
|
||||||
if (has_frame_) {
|
styleMask:NSTitledWindowMask | NSClosableWindowMask |
|
||||||
atomWindow = [[AtomNSWindow alloc]
|
NSMiniaturizableWindowMask | NSResizableWindowMask |
|
||||||
initWithContentRect:cocoa_bounds
|
NSTexturedBackgroundWindowMask
|
||||||
styleMask:style_mask
|
backing:NSBackingStoreBuffered
|
||||||
backing:NSBackingStoreBuffered
|
defer:YES];
|
||||||
defer:YES];
|
|
||||||
} else {
|
|
||||||
atomWindow = [[AtomFramelessNSWindow alloc]
|
|
||||||
initWithContentRect:cocoa_bounds
|
|
||||||
styleMask:style_mask
|
|
||||||
backing:NSBackingStoreBuffered
|
|
||||||
defer:YES];
|
|
||||||
[atomWindow setOpaque:NO];
|
|
||||||
[atomWindow setBackgroundColor:[NSColor clearColor]];
|
|
||||||
}
|
|
||||||
|
|
||||||
[atomWindow setShell:this];
|
[atomWindow setShell:this];
|
||||||
window_ = atomWindow;
|
window_ = atomWindow;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue