-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fixed TabItem MinWidth issue #10865
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
Fixed TabItem MinWidth issue #10865
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fixes the oversized TabItem minimum width by removing the explicit MinWidth property and reducing MinHeight for improved usability.
- Dropped
MinWidth="180"
from TabItem and TabControl templates. - Updated
MinHeight
from 36 to 32 across all themes.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Light.xaml | Removed MinWidth and set MinHeight="32" on TabItem Border |
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.HC.xaml | Same updates for high-contrast theme |
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Dark.xaml | Same updates for dark theme |
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/TabControl.xaml | Removed MinWidth and set MinHeight="32" on TabControl Border |
Comments suppressed due to low confidence (4)
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/TabControl.xaml:228
- The
Margin="0"
setting was dropped here as well; restoring it will prevent unintended layout shifts in the TabControl.
<Border x:Name="Border" MinHeight="32" Padding="6" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" ...>
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Light.xaml:4724
- The original
Margin="0"
was removed; re-add it to maintain the intended layout and spacing.
<Border x:Name="Border" MinHeight="32" Padding="6" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" CornerRadius="8,8,0,0">
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.HC.xaml:4628
- The original
Margin="0"
was removed; re-add it to preserve consistent spacing in the high-contrast theme.
<Border x:Name="Border" MinHeight="32" Padding="6" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" CornerRadius="8,8,0,0">
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Dark.xaml:4715
- The original
Margin="0"
was removed; re-add it to keep the dark theme’s TabItem aligned as before.
<Border x:Name="Border" MinHeight="32" Padding="6" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding Borde
8000
rBrush}" BorderThickness="1,1,1,0" CornerRadius="8,8,0,0">
src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Light.xaml
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10865 +/- ##
===================================================
- Coverage 13.51732% 13.44513% -0.07219%
===================================================
Files 3319 3319
Lines 664895 664895
Branches 74675 74675
===================================================
- Hits 89876 89396 -480
- Misses 572473 572945 +472
- Partials 2546 2554 +8
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
4ee5d12
to
4320e26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, style changes.
Fixes #9889
Description
Fixes the unusally large MinWidth property in TabItem. Due to the large value for the min width, TabControl was less usable. This PR fixes that by removing the MinWidth property and readjusting some other values for TabItem.
Customer Impact
Makes TabControl and TabItem more usable
Regression
No
Testing
Local app testing
Risk
Minimal
Microsoft Reviewers: Open in CodeFlow