2020-10-20 19:02:45 -05:00
|
|
|
use crate::{Parent, Size};
|
2020-10-17 13:35:39 -05:00
|
|
|
|
|
|
|
/// The dpi scaling policy of the window
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum WindowScalePolicy {
|
2020-10-20 19:02:45 -05:00
|
|
|
/// Use the system's dpi scale factor
|
|
|
|
SystemScaleFactor,
|
|
|
|
/// Use the given dpi scale factor (e.g. `1.0` = 96 dpi)
|
2020-10-20 19:11:47 -05:00
|
|
|
ScaleFactor(f64),
|
2020-10-17 13:35:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/// The options for opening a new window
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct WindowOpenOptions {
|
|
|
|
pub title: String,
|
|
|
|
|
2020-10-20 19:17:20 -05:00
|
|
|
/// The logical size of the window.
|
|
|
|
///
|
|
|
|
/// These dimensions will be scaled by the scaling policy specified in `scale`. Mouse
|
2020-10-20 19:18:42 -05:00
|
|
|
/// position will be passed back as logical coordinates.
|
2020-10-20 19:02:45 -05:00
|
|
|
pub size: Size,
|
2020-10-17 13:35:39 -05:00
|
|
|
|
2020-10-20 19:02:45 -05:00
|
|
|
/// The dpi scaling policy
|
2020-10-17 13:35:39 -05:00
|
|
|
pub scale: WindowScalePolicy,
|
|
|
|
|
|
|
|
pub parent: Parent,
|
|
|
|
}
|