Skip to content

Fix high-DPI and large font scaling - #135

Merged
abart27 merged 4 commits into
mainfrom
fix-dpi-scaling
Apr 1, 2026
Merged

abart27 merged 4 commits into
mainfrom
fix-dpi-scaling

Conversation

@abart27

@abart27 abart27 commented Mar 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes scaling on systems with high DPI or large font sizes.

Closes #124

Copilot AI review requested due to automatic review settings March 30, 2026 13:17
@abart27
abart27 requested a review from luttje March 30, 2026 13:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates WinForms startup configuration to improve High-DPI behavior by using the SDK-provided ApplicationConfiguration.Initialize() path and setting the project’s DPI mode to SystemAware.

Changes:

  • Replaced explicit WinForms startup calls with ApplicationConfiguration.Initialize() in Program.cs.
  • Configured WinForms defaults via MSBuild properties (visual styles, text rendering, High DPI mode) in the GUI project file.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Key2Joy.Gui/Program.cs Switches WinForms initialization to ApplicationConfiguration.Initialize() prior to showing the startup form.
Key2Joy.Gui/Key2Joy.Gui.csproj Sets WinForms app defaults including ApplicationHighDpiMode=SystemAware to address High-DPI scaling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@abart27 abart27 changed the title Fix scaling on High-DPI monitors Fix high-DPI and large font scaling Mar 30, 2026
@abart27
abart27 requested a review from Copilot March 30, 2026 13:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Key2Joy.Gui/ConfigForm.cs
var selected = Enum.Parse(enumConfigControlAttribute.EnumType, value.ToString());
ComboBox control = new()
{
AutoSize = true,

Copilot AI Mar 30, 2026

Copy link

Choose a reason for hiding this comment

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

ComboBox.AutoSize is documented as not relevant for System.Windows.Forms.ComboBox, so this won’t help with DPI/large-font sizing for enum controls and may give a false sense that the scaling issue is addressed here. Consider removing AutoSize and, if height needs to follow font scaling, set the control’s height based on PreferredHeight (or avoid forcing the height at all and rely on DPI autoscaling).

Suggested change
AutoSize = true,

Copilot uses AI. Check for mistakes.

@luttje luttje left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm on my phone so I can't test this, but the changes look approve-able.
I didn't know it took this little code to get this done! Thanks 🙏

Tested it just now, works!

@abart27
abart27 merged commit 27542c2 into main Apr 1, 2026
2 checks passed
@abart27
abart27 deleted the fix-dpi-scaling branch April 1, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Respect windows scaling

3 participants