Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sizing down the ClientSize on Mac make the windows go down #3293

Open
NicolasDorier opened this issue Nov 26, 2019 · 0 comments
Open

Sizing down the ClientSize on Mac make the windows go down #3293

NicolasDorier opened this issue Nov 26, 2019 · 0 comments
Labels

Comments

@NicolasDorier
Copy link

NicolasDorier commented Nov 26, 2019

This hack solves it.

void ResizeHack()
{
    Size newSize = MainViewModel.IsVisible ? ExpandedSize : NormalSize;

    if (newSize != this.ClientSize)
    {
        this.ClientSize = newSize;
        // On Mac, resizing down will make the windows jump down, so we need to set it back up
        if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && newSize == NormalSize)
        {
            this.Position = this.Position.WithY(this.Position.Y - (int)(ExpandedSize.Height - NormalSize.Height));
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants