diff options
author | 2021-06-25 18:03:18 +0200 | |
---|---|---|
committer | 2021-06-25 18:03:18 +0200 | |
commit | de79a01b88e1610d374ed06077ac78f3e10b9c3d (patch) | |
tree | 679bec69f434182ee17a0e2da55a29b454334ed8 /src | |
parent | 5c45d36d1a8cfd92cd1a454a7f4deedcd4d13fe7 (diff) | |
download | iced-de79a01b88e1610d374ed06077ac78f3e10b9c3d.tar.gz iced-de79a01b88e1610d374ed06077ac78f3e10b9c3d.tar.bz2 iced-de79a01b88e1610d374ed06077ac78f3e10b9c3d.zip |
done
Diffstat (limited to 'src')
-rw-r--r-- | src/window/settings.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/window/settings.rs b/src/window/settings.rs index 981f0858..0fecc3bb 100644 --- a/src/window/settings.rs +++ b/src/window/settings.rs @@ -8,8 +8,23 @@ pub struct Settings { /// The initial position of the window. /// + /// When the decorations of the window are enabled, Windows 10 will add some inivisble padding + /// to the window. This padding gets included in the position. So if you have decorations + /// enabled and want the window to be at 0,0 you would have to set the position to + /// -DPI_BORDER_X,-DPI_BORDER_Y. + /// + /// DPI_BORDER_X/DPI_BORDER_Y are the usual size of the padding, which changes based on the DPI of the display. + /// + /// On a 1920x1080 monitor you would have to set the position to -8,-2. + /// + /// For info on how you could implement positioning that supports all DPI monitors look at the + /// following WINAPI calls: + /// + /// * GetDpiForMonitor (with MDT_RAW_DPI) + /// * GetSystemMetricsForDpi (with SM_CXFRAME and SM_CYFRAME) + /// /// Note: this gets ignored on the web - pub position: (u32, u32), + pub position: (i32, i32), /// The minimum size of the window. pub min_size: Option<(u32, u32)>, |