slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.4k stars 541 forks source link

More size units, such as vw, vh #3676

Open CarbonPool opened 9 months ago

CarbonPool commented 9 months ago

How to be compatible with devices with different resolutions, you need to use adaptive size units

tronical commented 9 months ago

Hi! Could you elaborate what you mean with adaptive size units? We have rem as font size relative to the Window's default font size, and we have px that's scaling with different device pixel densities.

Edit: I see now, you're suggesting that we add a unit that scales with the width and height of the Window element's width or height without having to access the Window.

CarbonPool commented 9 months ago

Hi! Could you elaborate what you mean with adaptive size units? We have rem as font size relative to the Window's default font size, and we have px that's scaling with different device pixel densities.

Edit: I see now, you're suggesting that we add a unit that scales with the width and height of the Window element's width or height without having to access the Window.

Yes, this can adapt to screens with different resolutions