8000 Fixed TabItem MinWidth issue by dipeshmsft · Pull Request #10865 · dotnet/wpf · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 2 commits into from
May 21, 2025

Conversation

dipeshmsft
Copy link
Member
@dipeshmsft dipeshmsft commented May 21, 2025

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

@Copilot Copilot AI review requested due to automatic review settings May 21, 2025 05:50
@dipeshmsft dipeshmsft requested a review from a team as a code owner May 21, 2025 05:50
@dipeshmsft dipeshmsft requested a review from harshit7962 May 21, 2025 05:51
@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label May 21, 2025
@dipeshmsft dipeshmsft added Win 11 Theming and removed PR metadata: Label to tag PRs, to facilitate with triage labels May 21, 2025
Copy link
Contributor
@Copilot Copilot AI left a 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">

Copy link
codecov bot commented May 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 13.44513%. Comparing base (0d13fd5) to head (4320e26).
Report is 2 commits behind head on main.

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     
Flag Coverage Δ
Debug 13.44513% <ø> (-0.07219%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dipeshmsft dipeshmsft force-pushed the fluent/bugs/tabitem-minwidth branch from 4ee5d12 to 4320e26 Compare May 21, 2025 06:41
Copy link
Member
@harshit7962 harshit7962 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, style changes.

@harshit7962 harshit7962 self-assigned this May 21, 2025
@dipeshmsft dipeshmsft merged commit dcf162f into dotnet:main May 21, 2025
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fluent2 TabItem MinWidth Is Too Large
3 participants
0