Skip to content

Fix DarkUI's floating toolbox on higher DPI monitors#1217

Open
Stranger1992 wants to merge 1 commit into
developfrom
fix-object-placement-toolbox-scaling
Open

Fix DarkUI's floating toolbox on higher DPI monitors#1217
Stranger1992 wants to merge 1 commit into
developfrom
fix-object-placement-toolbox-scaling

Conversation

@Stranger1992
Copy link
Copy Markdown
Member

This pull request addresses high-DPI scaling issues by modifying how DPI awareness is handled in the application and by explicitly setting scaling properties for a custom control. These changes aim to provide more predictable UI rendering, particularly on high-DPI displays.

DPI scaling and rendering adjustments:

  • Changed the application's DPI mode to DpiUnaware in Program.cs to prevent automatic DPI scaling, ensuring consistent rendering across different display settings.
  • Set AutoScaleMode to None and defined AutoScaleDimensions in the DarkFloatingToolBox control to disable automatic scaling and specify a fixed design-time DPI, helping maintain consistent control sizing.

Copilot AI review requested due to automatic review settings May 2, 2026 11:44
@Stranger1992 Stranger1992 requested review from Lwmte and Nickelony May 2, 2026 11:45
Copy link
Copy Markdown
Contributor

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

This PR aims to address high-DPI rendering issues affecting DarkUI floating toolboxes by changing the app’s DPI awareness mode and disabling autoscaling on the DarkFloatingToolbox control.

Changes:

  • Changed TombEditor’s process DPI mode from SystemAware to DpiUnaware.
  • Disabled WinForms autoscaling on DarkFloatingToolbox and set a fixed AutoScaleDimensions baseline.

Reviewed changes

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

File Description
TombEditor/Program.cs Changes the process-wide WinForms DPI awareness mode at startup.
DarkUI/DarkUI/Controls/DarkFloatingToolBox.cs Adjusts autoscaling behavior for the floating toolbox base control.

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

Comment thread TombEditor/Program.cs
Application.EnableVisualStyles();
Application.SetDefaultFont(new System.Drawing.Font("Segoe UI", 8.25f));
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.SetHighDpiMode(HighDpiMode.DpiUnaware);
ClampDimensions();

this.AutoScaleMode = AutoScaleMode.None;
this.AutoScaleDimensions = new SizeF(96F, 96F);
Copy link
Copy Markdown
Collaborator

@Nickelony Nickelony left a comment

Choose a reason for hiding this comment

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

I cannot approve switching to DpiUnaware, as this is a major breaking change that is most definitely going to break everything. There needs to be another way to solve this issue, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants