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

[WinUI] MenuFlyout width error on the first time popup #73

Closed
emako opened this issue Feb 7, 2023 · 3 comments
Closed

[WinUI] MenuFlyout width error on the first time popup #73

emako opened this issue Feb 7, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@emako
Copy link

emako commented Feb 7, 2023

Describe the bug

        <notifyIcon:TaskbarIcon
            x:Name="TaskbarIconApp"
            DoubleClickCommand="{x:Bind ViewModel.ActiveOrHideAppCommand}"
            MenuActivation="RightClick"
            NoLeftClickDelay="True"
            IconSource="{x:Bind base:Pack.UriIcon}"
            ContextMenuMode="SecondWindow">
            <notifyIcon:TaskbarIcon.ContextFlyout>
                <MenuFlyout Placement="RightEdgeAlignedTop" AreOpenCloseAnimationsEnabled="False">
                    <MenuFlyoutItem Width="180" MaxWidth="180" Text="显示/隐藏" Command="{x:Bind ViewModel.ActiveOrHideAppCommand}" />
                    <MenuFlyoutSeparator/>
                    <MenuFlyoutItem Width="180" MaxWidth="180" Text="退出" Icon="Cancel" Command="{x:Bind ViewModel.ExitAppCommand}" />
                </MenuFlyout>
            </notifyIcon:TaskbarIcon.ContextFlyout>
        </notifyIcon:TaskbarIcon>

Steps to reproduce the bug

No response

Expected behavior

No response

Screenshots

first time popup -> Error width
image

second time popup -> allright
image

How can I handle for fixed width?

NuGet package version

Platform

No response

IDE

Visual Studio 2022

Windows Version

Windows 11

WindowsAppSDK Version

1.1

WindowsAppSDK Type

Packaged

Manifest

No response

Additional context

No response

@emako emako added the bug Something isn't working label Feb 7, 2023
@kqakqakqa
Copy link

This also happens to me, on first time popup when MenuFlyoutItem has an icon

image

image

<tb:TaskbarIcon ContextMenuMode="SecondWindow" NoLeftClickDelay="True">
    <tb:TaskbarIcon.ContextFlyout>
        <MenuFlyout AreOpenCloseAnimationsEnabled="False">

            <MenuFlyoutItem Icon="Sync" Text="Refresh"/>
            <MenuFlyoutSeparator />
            <MenuFlyoutItem Text="Exit1234567890"/>
            
        </MenuFlyout>
    </tb:TaskbarIcon.ContextFlyout>
</tb:TaskbarIcon>

@HavenDV
Copy link
Owner

HavenDV commented Mar 30, 2024

As far as I remember, I'm currently not taking icons into account when calculating the initial width, so that's a good point.
There is a bug in WinUI with different widths during the first display and after, which we are trying to adapt to so that there is no difference, and they are not going to fix it

@emako
Copy link
Author

emako commented May 31, 2024

give up

@emako emako closed this as not planned Won't fix, can't repro, duplicate, stale May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants