dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.99k stars 1.72k forks source link

[Windows] [Scenario Day] Wrong secondary ToolbarItem size #7156

Open jsuarezruiz opened 2 years ago

jsuarezruiz commented 2 years ago

Description

Wrong secondary ToolbarItem size on Windows. image

Also de popup is bigger than expected.

Steps to Reproduce

  1. Download ToolbarItemsDemo.zip
  2. Open the secondary items menu.

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows App SDK 17134

Did you find any workaround?

No response

Relevant log output

No response

XamlTest commented 2 years ago

Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32427.455.main]. Repro on Windows. Sample Project: ToolbarItemsDemo.zip

pekspro commented 2 years ago

I have the same problem. This is in MAUI:

<ContentPage.ToolbarItems>
  <ToolbarItem Text="Pick me!" Order="Secondary" />
</ContentPage.ToolbarItems>

image

And this is in WinUI 3:

<CommandBar>
    <CommandBar.SecondaryCommands>
        <AppBarButton Label="Pick me"/>
    </CommandBar.SecondaryCommands>
</CommandBar>

image

PureWeen commented 2 years ago

related https://github.com/dotnet/maui/issues/7034

ghost commented 2 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

nicop85 commented 1 year ago

Same problem here and it got worse in my case. The size is wrong as shown in the description of this bug, but also de text is displayed in white color. Only on mouse over, it turns black making the text legible.

When opened: image

When mouse over: image

I tried this in a File -> New -> Project... with the current latest MAUI version 7.0.59

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.6.0 Preview 6.0. Repro on Windows 11 with below Project: 7156.zip

image

nicop85 commented 10 months ago

This is still failing with the last updates (Visual Studio 17.8.0, .Net 8, MAUI 8.0.3) It really ugly to display the secondary menus in such way.

Please, give some priority to this issue

Auto72 commented 1 week ago

The following code can FIX the BUG about the size of the secondary toolbar items:

Microsoft.Maui.Handlers.ToolbarHandler.Mapper.AppendToMapping("MyCustomization", (handler, view) =>
 {

     handler.PlatformView.FontSize = 14;
     handler.PlatformView.SizeChanged += (f, o) =>
     {
         var toolbar = f as Microsoft.Maui.Platform.MauiToolbar;                 
         var grid = toolbar.Content as Microsoft.UI.Xaml.Controls.Grid;
         dynamic k = grid.Children[grid.Children.Count - 2];
         k.Child.FontSize = 28;                    
     };
     //handler.PlatformView.BackgroundSizing= Microsoft.UI.Xaml.Controls.BackgroundSizing.InnerBorderEdge;
 });

But the colour BUG is still present.