RobinPerris / DarkUI

Dark themed control and docking library for .NET WinForms.
MIT License
837 stars 186 forks source link

High DPI scale doesn't work #30

Closed iOrange closed 4 years ago

iOrange commented 4 years ago

I just tried DarkUI, and if the DPI scale in Windows is set to > 100%, and the Application is set to be DPI aware - the DarkUI completely breaks, as it's not responding to Font scale.

DarkUI_hdpi

Lwmte commented 4 years ago

Sadly, this is the biggest issue with DarkUI. It uses a lot of pixel-perfect control drawing routines, so it doesn't scale at all. It seems it's impossible to fix without full rewrite.

iOrange commented 4 years ago

That's sad because I love how DarkUI looks. Thanks for returning my question!

BTW - do you have any plans on making DarkUI for WPF ?

Lwmte commented 4 years ago

I guess it won't happen... neither on master nor on our branch (https://github.com/Lwmte/DarkUI/), it's easier to use existing dark-themed WPF projects.

RobinPerris commented 4 years ago

I just tried DarkUI, and if the DPI scale in Windows is set to > 100%, and the Application is set to be DPI aware - the DarkUI completely breaks, as it's not responding to Font scale.

Unfortunately pixel-perfect drawing is a core design aspect of DarkUI. Changing it would require re-writing the majority of the rendering logic which I personally won't be doing. DarkUI is (loosely) maintained with bugs fixed, but it's a legacy product at this point.

You can sledgehammer your app to remove DPI scaling to 'fix' the problem as discussed on Stack Overflow... but it's not a pretty solution.

If you do need DPI-awareness support in your app, I'd highly recommend not using WinForms and use a more modern windowing system like WPF.

That's sad because I love how DarkUI looks. Thanks for returning my question!

BTW - do you have any plans on making DarkUI for WPF ?

I don't think DarkUI for WPF is really required? DarkUI was created because you can't set the border colour on something as simple as a textbox in WinForms - I needed code hacks to bypass those limitations. As WPF is pure DirectX those limitations no longer exist and you should be able to get similar effects by just modifying the properties accordingly.

If you like the look of it, pick up any of the JetBrains IDEs and copy the colours from there - that's all I did. 😋

Regardless, I develop all of my apps to run across macOS and Linux now-a-days, and WPF is limited to just Windows so it's off the table for me.