aelyo-softworks / Wice

Windows Interface Composition Engine is a .NET C# UI engine for creating Windows application.
Other
115 stars 6 forks source link

4K and Scaling #12

Open kalatchev opened 5 months ago

kalatchev commented 5 months ago

Kudos for the project!

I found that at least demo, is not scaling aware.

smourier commented 5 months ago

Hi,

Thanks! I'm working on an AOT version but I'm waiting for some Microsoft's pieces improvements (namely C#/WinRT).

It's not aware in the sense that the application's window will not scale when moved from say a 100% to a 150% screen but it's aware in the sense that it's declared as dpiAwareness PerMonitorV2, and it should not disfunction (as some UI framework do even when they are supposedly "aware") when moved over, ie: the whole window should display fine and identical when moved around, unless I've missed something.

It also means you should be able to add some custom code, or override things to adapt if needed.

Do you have a specific scenario in mind?

MIRIMIRIM commented 5 months ago

I’m not sure if this is the case he’s talking about, but the following image shows the display effect at 150%, and these appears to be smaller than when I started at 100%.

image

smourier commented 5 months ago

How exactly do you get to see that? This is what I get with a 150% scale:

image

MIRIMIRIM commented 5 months ago

I use a 14-inch laptop with Windows11 24H2, the previous screenshot was of me maximizing the window

image

smourier commented 5 months ago

I don't reproduce what you see, it seems related to rich text boxes (codebox that display sample colorized sample code). Other texts seems the same size.

I've added some extra diagnostics you can post here (you must get latest and recompile), here is mine (in About / System Info):

image

MIRIMIRIM commented 5 months ago

image

smourier commented 5 months ago

Ok, I get it, it's related to the primary display, I have two and was doing my testing with a non-primary one. You have only one. When I change DPI for the primary one I also see bigger Rich Text Boxes.

Rich Text Box is one of rare Wice components that rely on an underlying windows component (Richedit or Office Richedit https://learn.microsoft.com/en-us/windows/win32/controls/about-rich-edit-controls). Apparently this behaves in a way that causes the difference between Wice texts and Rich Text Box texts.

I need to investigate this further.

smourier commented 5 months ago

Ok I've made some changes in RichTextBox code (and also in titlebar which had some issues in hi-DPI contexts too). Can you try it?

MIRIMIRIM commented 5 months ago

RichTextBox and titlebar look fine

old

5df5926a9502f1cce93b5e47f9b911e3

new

2e180663fe1102aef42500e57295a888