Skip to content

Commit

Permalink
Merge branch 'master' into fixes/RightToLeftTextWrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Gillibald authored Jul 15, 2021
2 parents d5a2fc4 + fd656d5 commit 52dc718
Show file tree
Hide file tree
Showing 51 changed files with 1,794 additions and 628 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ _NCrunch_*/
*.ncrunchsolution.user
nCrunchTemp_*

# CodeRush
.cr/

# Others
sql/
*.Cache
Expand Down
36 changes: 27 additions & 9 deletions native/Avalonia.Native/src/OSX/window.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
IAvnMenu* _mainMenu;

bool _shown;
bool _inResize;

WindowBaseImpl(IAvnWindowBaseEvents* events, IAvnGlContext* gl)
{
_shown = false;
_inResize = false;
_mainMenu = nullptr;
BaseEvents = events;
_glContext = gl;
Expand Down Expand Up @@ -277,6 +279,13 @@ virtual HRESULT SetMinMaxSize (AvnSize minSize, AvnSize maxSize) override

virtual HRESULT Resize(double x, double y) override
{
if(_inResize)
{
return S_OK;
}

_inResize = true;

START_COM_CALL;

@autoreleasepool
Expand Down Expand Up @@ -304,13 +313,19 @@ virtual HRESULT Resize(double x, double y) override
y = maxSize.height;
}

if(!_shown)
@try
{
BaseEvents->Resized(AvnSize{x,y});
if(!_shown)
{
BaseEvents->Resized(AvnSize{x,y});
}

[Window setContentSize:NSSize{x, y}];
}
@finally
{
_inResize = false;
}

[StandardContainer setFrameSize:NSSize{x,y}];
[Window setContentSize:NSSize{x, y}];

return S_OK;
}
Expand Down Expand Up @@ -757,6 +772,7 @@ void WindowStateChanged () override
}

_lastWindowState = state;
_actualWindowState = state;
WindowEvents->WindowStateChanged(state);
}
}
Expand Down Expand Up @@ -1276,6 +1292,9 @@ -(AutoFitContentView* _Nonnull) initWithContent:(NSView *)content
[_blurBehind setWantsLayer:true];
_blurBehind.hidden = true;

[_blurBehind setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[_content setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];

[self addSubview:_blurBehind];
[self addSubview:_content];

Expand Down Expand Up @@ -1311,9 +1330,6 @@ -(void)setFrameSize:(NSSize)newSize
_settingSize = true;
[super setFrameSize:newSize];

[_blurBehind setFrameSize:newSize];
[_content setFrameSize:newSize];

auto window = objc_cast<AvnWindow>([self window]);

// TODO get actual titlebar size
Expand All @@ -1329,6 +1345,7 @@ -(void)setFrameSize:(NSSize)newSize
[_titleBarMaterial setFrame:tbar];
tbar.size.height = height < 1 ? 0 : 1;
[_titleBarUnderline setFrame:tbar];

_settingSize = false;
}

Expand Down Expand Up @@ -2374,11 +2391,12 @@ virtual NSWindowStyleMask GetStyle() override

virtual HRESULT Resize(double x, double y) override
{
START_COM_CALL;

@autoreleasepool
{
if (Window != nullptr)
{
[StandardContainer setFrameSize:NSSize{x,y}];
[Window setContentSize:NSSize{x, y}];

[Window setFrameTopLeftPoint:ToNSPoint(ConvertPointY(lastPositionSet))];
Expand Down
102 changes: 0 additions & 102 deletions samples/ControlCatalog/Pages/ContextFlyoutPage.axaml

This file was deleted.

45 changes: 0 additions & 45 deletions samples/ControlCatalog/Pages/ContextFlyoutPage.axaml.cs

This file was deleted.

Loading

0 comments on commit 52dc718

Please sign in to comment.