uno.toolkit.ui
uno.toolkit.ui copied to clipboard
`Flyout` should not be stretched horizontally on large screen
Current behavior
When adding
<MaterialToolkitTheme xmlns="using:Uno.Toolkit.UI.Material"
ColorOverrideSource="ms-appx:///unoExtensionBasicApp/Styles/ColorPaletteOverride.xaml"
FontOverrideSource="ms-appx:///unoExtensionBasicApp/Styles/MaterialFontsOverride.xaml" />
you are able to have Flyout
stretch horizontally on large screen apps, while on Windows default style has a hard-coded maximum width that prevents this behavior (the Flyout
will be full-screen on small devices and only "above the content" on "large window").
This is causing some issues like https://github.com/unoplatform/uno/issues/12871
Expected behavior
Like the default style on windows, the Flyout
should have a max width.
How to reproduce it (as minimally and precisely as possible)
cf. repro of https://github.com/unoplatform/uno/issues/12871
Nuget Package: Package Version(s): Affected platform(s):
- [x] WebAssembly
- [ ] Android
- [ ] iOS
- [ ] macOS (AppKit)
- [ ] Mac Catalyst
- [x] Skia
- [x] WPF
- [x] GTK (Linux)
- [x] Linux Framebuffer
- [x] Tizen
- [x] Windows
IDE:
- [ ] Visual Studio 2022
- [ ] Visual Studio 2019
- [ ] Visual Studio Code
- [ ] Visual Studio for Mac
- [ ] Rider Windows
- [ ] Rider macOS
Relevant plugins:
Anything else we need to know?
I was unable to repro that issue in a simpler app, not even sure how / why the Flyout
is stretching like that.
So thanks to @kazo0 , I found that this is actually caused by https://github.com/unoplatform/Uno.Themes/blob/321b2154bc547e0b3202cca160b2def25d3b3685/src/library/Uno.Material/Styles/Controls/v2/Flyout.xaml#L37
This should be reviewed with design, but IMHO we should not do that as it goes against Window's behavior (which applies a MaxWidth
on large screen).