-
Notifications
You must be signed in to change notification settings - Fork 708
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
Question: Why does NavigationView enforce min width for custom content pane #2890
Comments
@YuliKl FYI @chingucoding how are you getting the app window to be so narrow? isn't there a min window width? |
In compact overlay the minimum dimensions are 150x50 if I recall correctly. |
To be honest, that feels like a bug. We usually forget to take compact overlay mode into account, assuming we have more horizontal space to work with in the min case. And while I can hypothesize some rationale of wanting to maintain a bit of whitespace between items and footer, the custom content area feels like a strange column to do this in. I'm not clear whether removing that minWidth is likely to cause a breaking change for apps. @licanhua, any thoughts on this one? |
It's from designer. |
I am not sure if we should remove it entirely, after all this is a niche case. However it's a bit annoying that I would need to retemplate the NavigationView in order to get rid of the 48px gap, which in compact overlay, can be almost a third of the available width when the app is in it's minimum dimensions. Having a themeresource for the minimum size of the gap, or a property which disables the minimum size, would probably be a good compromise. Existing apps wouldn't change the behavior, yet if they need, they can remove that. Also in the gif I shared, I used different visual states to hide items when the windows gets narrow to still be able to show a button to exist compact overlay. After all, you have to make sacrifices with such small sizes. Without the enforced gap, the button would still be visible with the narrow size of 150px. |
I would support adding a resource for this with the same 48px default as today. |
Would it be fine if I make this change then @ranjeshj ? |
That sounds reasonable to avoid re-templating. @chingucoding go for it. Thanks! |
The NavigationView enforces a minwidth of 48px for custom pane content when in DisplayMode top:
microsoft-ui-xaml/dev/NavigationView/NavigationView.xaml
Line 236 in 1672b33
However this can seem a bit strange in compact overlay which allows a very narrow window, which can result in content being pushed off the screen by essentially nothing as the 48px are always being enforced.
See this gif for an example of how it currently behaves:
![gif](https://user-images.githubusercontent.com/16122379/87258028-9f05f280-c4a0-11ea-8eb9-1fe371504b92.gif)
Currently the only way to get rid of it, is to retemplate the control. Should we introduce a lightweight styling resource for this, to make it easier to customize this?
The text was updated successfully, but these errors were encountered: