TestCentric / testcentric-gui

TestCentric GUI Runner for NUnit
Other
66 stars 29 forks source link

Unfortunate side effect of 'Native high-DPI monitor support' #107

Closed mikkelbu closed 2 months ago

mikkelbu commented 5 years ago

On my laptop the 'Native high-DPI monitor support' change has an unfortunate side effect which makes the UI look strange in a lot of places. I'm not sure if the problem is how we are specifying fonts the UI.

Sorry for the large images below, but the combination of my screen resolution and how GitHub is presenting images makes it look like I need glasses :)

Examples

Settings - Text output

Without change (blurry, but reasonable since fonts) image

With change (sharp, but too large fonts) image

About dialog

Without the change image

With the change image

CharliePoole commented 5 years ago

It's interesting how the About box example uses two different fonts. That may be a clue.

Probably this should wait till after merging issue-95g, since it includes changes to how the font is selected.

CharliePoole commented 5 years ago

@mikkelbu I marked this for re-confirmation (on current master) since the code has changed quite a bit.

CharliePoole commented 5 years ago

@mikkelbu Are you still seeing this?

CharliePoole commented 5 years ago

@mikkelbu I added this to the 1.0 beta milestone, but I can't replicate it on my system. No surprise since it's a Windows 7 VM running on my Linux laptop. Can you investigate further or tell me if there's a way to make this appear?

CharliePoole commented 5 years ago

@mikkelbu I took the liberty of assigning this to you, since it appears you're the only one with a shot at seeing and fixing it. If you can't get to it, we can switch it to the post-1.0 milestone.

CharliePoole commented 5 years ago

@mikkelbu Have you been able to look at this one again?

mikkelbu commented 5 years ago

@CharliePoole Sorry, I've been quite busy the last couple of months. I'm still seeing this as far as I can remember. I'll see if I have time to look more closely at this tonight or tomorrow night.

CharliePoole commented 5 years ago

I can move it to the post-1.0 milestone but it would be nice if you could at least re-confirm it. Thanks.

mikkelbu commented 5 years ago

I can confirm it. On the HEAD of master my screens looks like this.

If I add (inspiration from https://developer.rhino3d.com/guides/rhinocommon/supporting-high-dpi-displays/)

this.AutoScaleMode = AutoScaleMode.Font;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

to the beginning of InitializeComponent and remove this.label4.Font = .... - all changes in /Dialogs/AboutBox.cs - then it becomes a little better. But there will be much work to do by removing a lot of hardcoded fonts, locations, and sizes, and I don't think that I have time for it (at least not now).

CharliePoole commented 5 years ago

Thanks! At least we know it's still there. I moved it to the post-1.0 milestone, which is kind of a catch-all for stuff we want to do between 1.0 and 1.1.

maettu-this commented 3 months ago

Adding this to testcentric.exe.config could solve or at least improve the situation:

  <System.Windows.Forms.ApplicationConfigurationSection>
    <add key="DpiAwareness" value="PerMonitorV2" />
  </System.Windows.Forms.ApplicationConfigurationSection>

Had the same issue with my WinForms based project.

Reference: https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8

CharliePoole commented 3 months ago

Thanks! Looks like a great possibility. I'll try this and may ask you to check it out. Unfortunately, when @mikkelbu created this issue, I wasn't able to replicate it on my windows VM, so I have ignored it. My configuration has changed in the last few months, so I'll take another look. May ask you to verify the fix.

CharliePoole commented 3 months ago

OK, I've done a full review of this old bug, which I'd like to get rid of one way or another! I'd very much appreciate it if all those who have been involved with it take a second (or third or fourth...) look...

@jnm2 did the original commit for high-dpi support @mikkelbu reported this issue @maettu-this suggested a change to the config

Do you all still see this on beta4? If so at what resolution and scaling? I'm using a resolution of 2560 x 1440 on Linux with the Windows 10 VM set at 2484 x 1361. My normal scaling is 100% (I wear my reading glasses) but I have adjusted it to 200% for testing this issue. Unfortunately, I don't have a physical windows box any more.

My own thoughts...

What do you see?

maettu-this commented 3 months ago

I don't see the reported issue anymore, but the about dialog does cut the too long version string:

grafik

grafik

CharliePoole commented 3 months ago

@maettu-this Thanks. I should just be displaying 2.0.0-beta4 anyway.