diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.h b/brightray/browser/mac/bry_inspectable_web_contents_view.h index 87abc98c3549..49eff626321d 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.h +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.h @@ -2,7 +2,8 @@ @class BRYInspectableWebContentsViewPrivate; -@interface BRYInspectableWebContentsView : NSView { +@interface BRYInspectableWebContentsView + : NSView { @private BRYInspectableWebContentsViewPrivate *_private; } diff --git a/brightray/browser/mac/bry_inspectable_web_contents_view.mm b/brightray/browser/mac/bry_inspectable_web_contents_view.mm index 24987e5c1c5c..d4d8b374b06e 100644 --- a/brightray/browser/mac/bry_inspectable_web_contents_view.mm +++ b/brightray/browser/mac/bry_inspectable_web_contents_view.mm @@ -10,10 +10,34 @@ using namespace brightray; +@interface GraySplitView : NSSplitView { + BOOL dividerHidden_; +} +@property(assign, nonatomic) BOOL dividerHidden; +- (NSColor*)dividerColor; +- (CGFloat)dividerThickness; +@end + + +@implementation GraySplitView + +@synthesize dividerHidden = dividerHidden_; + +- (NSColor*)dividerColor { + return [NSColor darkGrayColor]; +} + +- (CGFloat)dividerThickness { + return dividerHidden_ ? 0 : [super dividerThickness]; +} + +@end + + @interface BRYInspectableWebContentsViewPrivate : NSObject { @public InspectableWebContentsViewMac *inspectableWebContentsView; - NSSplitView *splitView; + GraySplitView *splitView; NSWindow *window; BOOL visible; } @@ -45,7 +69,8 @@ void SetActive(content::WebContents* web_contents, bool active) { _private = [[BRYInspectableWebContentsViewPrivate alloc] init]; _private->inspectableWebContentsView = inspectableWebContentsView; - _private->splitView = [[NSSplitView alloc] init]; + _private->splitView = [[GraySplitView alloc] init]; + _private->splitView.delegate = self; [self addSubview:_private->splitView]; _private->splitView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; @@ -203,6 +228,12 @@ void SetActive(content::WebContents* web_contents, bool active) { [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:newWindow]; } +#pragma mark - NSSplitViewDelegate + +-(void)splitViewWillResizeSubviews:(NSNotification *)notification { + [[_private->splitView window] disableScreenUpdatesUntilFlush]; +} + #pragma mark - NSWindowDelegate - (BOOL)windowShouldClose:(id)sender { @@ -221,4 +252,4 @@ void SetActive(content::WebContents* web_contents, bool active) { @end @implementation BRYInspectableWebContentsViewPrivate -@end \ No newline at end of file +@end