summaryrefslogtreecommitdiffstats
path: root/winit/src/position.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2021-07-22 17:49:18 +0700
committerLibravatar GitHub <noreply@github.com>2021-07-22 17:49:18 +0700
commit9cf5f3e1ef19f67b7939b9a747c2f66ad6b5275c (patch)
tree4c9af75c3a0b7d0d7a5e664ec55fbdbc24cd9f88 /winit/src/position.rs
parent8fe8b6b168f193fadb495c78c076262d9114b14e (diff)
parent39b8f7de50ca53c67214c4ec2af2d3a0944f006a (diff)
downloadiced-9cf5f3e1ef19f67b7939b9a747c2f66ad6b5275c.tar.gz
iced-9cf5f3e1ef19f67b7939b9a747c2f66ad6b5275c.tar.bz2
iced-9cf5f3e1ef19f67b7939b9a747c2f66ad6b5275c.zip
Merge pull request #929 from TimUntersberger/winit-improv
feat: add position to window settings
Diffstat (limited to 'winit/src/position.rs')
-rw-r--r--winit/src/position.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/winit/src/position.rs b/winit/src/position.rs
new file mode 100644
index 00000000..c260c29e
--- /dev/null
+++ b/winit/src/position.rs
@@ -0,0 +1,22 @@
+/// The position of a window in a given screen.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum Position {
+ /// The platform-specific default position for a new window.
+ Default,
+ /// The window is completely centered on the screen.
+ Centered,
+ /// The window is positioned with specific coordinates: `(X, Y)`.
+ ///
+ /// When the decorations of the window are enabled, Windows 10 will add some
+ /// invisible 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
+ /// `(PADDING_X, PADDING_Y)`.
+ Specific(i32, i32),
+}
+
+impl Default for Position {
+ fn default() -> Self {
+ Self::Default
+ }
+}