Fix DarkUI's floating toolbox on higher DPI monitors#1217
Open
Stranger1992 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
SystemAwaretoDpiUnaware. - Disabled WinForms autoscaling on
DarkFloatingToolboxand set a fixedAutoScaleDimensionsbaseline.
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.
| 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); |
Nickelony
requested changes
May 2, 2026
Collaborator
Nickelony
left a comment
There was a problem hiding this comment.
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
DpiUnawareinProgram.csto prevent automatic DPI scaling, ensuring consistent rendering across different display settings.AutoScaleModetoNoneand definedAutoScaleDimensionsin theDarkFloatingToolBoxcontrol to disable automatic scaling and specify a fixed design-time DPI, helping maintain consistent control sizing.