microsoft / microsoft/WPF-Samples

TitleBar buttons are scaled very small at a resolution of 4K (288 DPI)

Open
#677 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

WPF Gallery
Dominant language
C#
Stars
5.7k
Forks
3.3k
Avg merge
12d 8h
Merged PRs (30d)
2

Description

Description

WPF Gallery Preview close button doesn’t have corners, the close button will be displayed as shown in the screenshot at a resolution of 3840 * 2160 (Set display scaling to 300% which results in 288 DPI).

Another issue is that the minimize, maximize, and close buttons are scaled very small (It also exists in Win32 and WinForms applications) at a resolution of 3840 * 2160 (300% scaling -> 288 DPI).

Actual behavior

Image

Expected behavior

Image

Reproduction Steps

Launch WPF Gallery Preview, change display resolution to 3840 * 2160, and set display scaling to 300% which results in 288 DPI.

Without using WPF Fluent theme

By the way, even without using WPF Fluent theme (.net 9), the TitleBar buttons are still scaled very small (It also exists in Win32 and WinForms applications) at a resolution of 3840 * 2160 (300% scaling -> 288 DPI). Can this problem be solved?

From the left: WPF, WinForms, Win32 (All small buttons) & WinUI 3 (Normal buttons):
Image

Image

Below are the test screenshots for 336 DPI (Small buttons) and 216 DPI (Normal buttons) configurations.

350% scaling -> 336 DPI: Windows Explorer (Left) & Microsoft Store (Right)
image

225% scaling -> 216 DPI: Windows Explorer (Left) & Microsoft Store (Right)
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the WPF Gallery Preview at 3840×2160 with 300% scaling (288 DPI), then compare the title-bar and close-button rendering with the expected screenshots. Done means the buttons are no longer unusually small and the close button has the expected corners; the issue does not name a file or test to inspect.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.