From afb3db9b27f501595fe44c6dcd4f53870fb6abb1 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Mon, 25 May 2020 22:12:52 +0300 Subject: [PATCH] Fake titlebar is now visible --- native/Avalonia.Native/src/OSX/window.mm | 27 ++++++++---------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/native/Avalonia.Native/src/OSX/window.mm b/native/Avalonia.Native/src/OSX/window.mm index ed43a98612..fc066e2481 100644 --- a/native/Avalonia.Native/src/OSX/window.mm +++ b/native/Avalonia.Native/src/OSX/window.mm @@ -1049,32 +1049,23 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent } } -- (void)layout -{ - [super layout]; -} - --(void)setFrame:(NSRect)frame -{ - [super setFrame:frame]; - - [_content setFrame:frame]; - - [_titleBarMaterial setFrame:frame]; -} - -(void)setFrameSize:(NSSize)newSize { - auto window = objc_cast([self window]); - [super setFrameSize:newSize]; [_content setFrameSize:newSize]; - [_titleBarMaterial setFrameSize:newSize]; + // TODO get actual titlebar size + float height = 38; + NSRect tbar; + tbar.origin.x = 0; + tbar.origin.y = newSize.height - height; + tbar.size.width = newSize.width; + tbar.size.height = height; - [super layout]; + [_titleBarMaterial setFrame:tbar]; } + @end @implementation AvnView