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

[Bug]: Maximize window to cover taskbar height when window width is limited #76

Closed
CodingOctocat opened this issue Jun 2, 2023 · 9 comments · Fixed by #82
Closed

[Bug]: Maximize window to cover taskbar height when window width is limited #76

CodingOctocat opened this issue Jun 2, 2023 · 9 comments · Fixed by #82
Assignees
Labels
bug Something isn't working Closed Issue Closed

Comments

@CodingOctocat
Copy link

Describe the bug

If the window is maximized when MaxWidth is set, the contents of the window will overflow to the taskbar.

<mica:MicaWindow x:Class="MicaWpfTest.MainWindow"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:mica="clr-namespace:MicaWPF.Controls;assembly=MicaWPF"
                 Title="MainWindow"
                 Width="800"
                 Height="450"
                 MaxWidth="1000"
                 SizeToContent="WidthAndHeight"
                 TitleBarType="WinUI"
                 mc:Ignorable="d">
    <StackPanel>
        <mica:Arc Height="30" />

        <mica:Button Content="12321" />

        <mica:TextBox />

        <Button Content="123213213" />
    </StackPanel>
</mica:MicaWindow>

image

Steps to reproduce the bug

As above.

Expected behavior

No response

Screenshots

No response

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

.Net Version

.NET 7.x

Additional context

No response

@Simnico99
Copy link
Owner

Simnico99 commented Jul 13, 2023

Without MicaWPF
image

With MicaWPF Maximized with limited witdth:
image

I will need more precision has I am not sure to understand what is the issue.

@CodingOctocat
Copy link
Author

I created a new blank project without MicaWPF and have the same problem, so it's a problem with WPF itself!
Can MicaWPF fix this?

  1. Set MaxWidth,then maximize window.(title bar is not normal, and Bottom at the back of the taskbar)

image

The expected result should be something like this:

image

@Simnico99
Copy link
Owner

Ah yes let me take a look at it

@CodingOctocat
Copy link
Author

We know that if the window is set to MaxWidth, then when maximized it will be maximized on the left side of the screen, which is a bad experience, and the correct behavior is to maximize with the window in the center, but it seems like a lot of work to do this, and the behavior of the maximize button has to be override (including double-clicking on the title bar to maximize, Win+UpArrow, and anything else that maximizes the window)

@Simnico99
Copy link
Owner

Do you think I should Actually prevent the user from maximizing the window when the maxwitdh value is not the default?

@CodingOctocat
Copy link
Author

CodingOctocat commented Jul 20, 2023

As shown in the picture:

When I maximize the window:

image

@Simnico99
Copy link
Owner

As shown in the picture:

When I maximize the window:

image

Yes Yes I Understood it's just that I will have to hook into all sort of events to figure this one out.

Its a complex task. I will see what I come up with.

@Simnico99
Copy link
Owner

image

Works with everything pushing to main branch.

@Simnico99 Simnico99 added Closed Issue Closed and removed Waiting for user Awaiting for user answer. labels Jul 21, 2023
@Simnico99
Copy link
Owner

Pushing version 6.1.3 it is now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Closed Issue Closed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants