microsoft / microsoft/microsoft-ui-xaml
TitleBar control calculation of padding is incorrect
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
The titlebar control does not take the scale factor into account when calculating the widths of the columns used for padding, resulting in incorrect positioning of elements.
### Steps to reproduce the bug
The code here: https://github.com/microsoft/microsoft-ui-xaml/blob/689477e7edfd3d33db6e63dd251aac3b4e159bab/src/controls/dev/TitleBar/TitleBar.cpp#L400-L411
needs to take the scale factor into account by dividing `rightColumnInset` (value in physical pixels) by the scale factor.
### Expected behavior
_No response_
### Screenshots
_No response_
### NuGet package version
WinUI 3 - Windows App SDK 1.7 Preview 1: 1.7.250208002-preview1
### Windows version
Windows 11 (24H2): Build 26100
### Additional context
_No response_
Contributor guide
Research direction
Start in src/controls/dev/TitleBar/TitleBar.cpp at lines 400-411 and inspect how rightColumnInset and the scale factor are used in the column-width calculation. Verify the behavior at a non-default display scale; done means the padding and titlebar elements are positioned correctly when the scale factor changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100