iced_core/window/
position.rs

1use crate::{Point, Size};
2
3/// The position of a window in a given screen.
4#[derive(Debug, Clone, Copy, Default)]
5pub enum Position {
6    /// The platform-specific default position for a new window.
7    #[default]
8    Default,
9    /// The window is completely centered on the screen.
10    Centered,
11    /// The window is positioned with specific coordinates: `(X, Y)`.
12    ///
13    /// When the decorations of the window are enabled, Windows 10 will add some
14    /// invisible padding to the window. This padding gets included in the
15    /// position. So if you have decorations enabled and want the window to be
16    /// at (0, 0) you would have to set the position to
17    /// `(PADDING_X, PADDING_Y)`.
18    Specific(Point),
19    /// Like [`Specific`], but the window is positioned with the specific coordinates returned by the function.
20    ///
21    /// The function receives the window size and the monitor's resolution as input.
22    ///
23    /// [`Specific`]: Self::Specific
24    SpecificWith(fn(Size, Size) -> Point),
25}