-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
TabControl - all TabItems Headers width is always set to the widest tab #2603
Comments
changing this to tabpanel, stackpanel or wrappanel should fix the issue MaterialDesignInXamlToolkit/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TabControl.xaml Lines 54 to 61 in 24c6468
|
UniformGrid`s children elements are same width/height. |
@veiny yeah that's what i found after looking into the code to track the issue changing the uniformgrid to any panel i suggested should fix the size thing if it was not intentional |
I would go with the scrollbar as per spec. As for the UniformGrid, I updated the TabControl a while ago and I can't remember if I put the UniformGrid there or if it was already present. Anyhow, the Material spec is not clear in wether this should be all the same width or not. All the examples have a same-width header so I did not think further than that. I think UniformGrid is used to achieve a full-width (accross the screen) TabControl and have the headers spaced evenly. |
i think having the same width is ok when tabs are centered but is not when its alignment is set to right or left |
This seems like a good compromise. |
beside #2602 using the example from the demo (changing HorizontalContentAlignment to left or right) but changing the second header to add more text will result in both tabs to have the second tab width (the widest tab)
![image](https://user-images.githubusercontent.com/7858946/158997610-a06214d8-89ef-4cfc-8a78-8d49fd3a642a.png)
<TabControl HorizontalContentAlignment="Left" materialDesign:ColorZoneAssist.Mode="SecondaryMid"> <TabItem Header="TAB1"> <TextBlock Margin="8" Text="Full-width secondary example tab 1" /> </TabItem> <TabItem Header="TABBBBBBBBBBBBBBBBBBBB 2"> <TextBlock Margin="8" Text="Full-width secondary example tab 2" /> </TabItem> </TabControl>
also it's doesn't handle overflow
![image](https://user-images.githubusercontent.com/7858946/158997937-e658e405-918b-4eaf-83fd-4e6c58d64dd7.png)
The text was updated successfully, but these errors were encountered: