iced-yoda/winit/src/settings.rs

51 lines
1.2 KiB
Rust
Raw Normal View History

//! Configure your application.
#[cfg(target_os = "windows")]
#[path = "settings/windows.rs"]
mod platform;
#[cfg(not(target_os = "windows"))]
#[path = "settings/not_windows.rs"]
mod platform;
2019-11-30 21:32:46 +09:00
pub use platform::PlatformSpecific;
/// The settings of an application.
#[derive(Debug, Clone, Copy, PartialEq, Default)]
pub struct Settings<Flags> {
/// The [`Window`] settings
///
/// [`Window`]: struct.Window.html
pub window: Window,
2019-12-29 12:29:47 +01:00
/// The data needed to initialize an [`Application`].
///
/// [`Application`]: trait.Application.html
pub flags: Flags,
}
/// The window settings of an application.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Window {
/// The size of the window.
pub size: (u32, u32),
/// Whether the window should be resizable or not.
pub resizable: bool,
2019-11-30 20:38:32 +09:00
/// Whether the window should have a border, a title bar, etc.
pub decorations: bool,
2019-11-30 21:32:46 +09:00
/// Platform specific settings.
2019-11-30 21:32:46 +09:00
pub platform_specific: platform::PlatformSpecific,
}
impl Default for Window {
fn default() -> Window {
Window {
size: (1024, 768),
resizable: true,
2019-11-30 20:38:32 +09:00
decorations: true,
2019-11-30 21:32:46 +09:00
platform_specific: Default::default(),
}
}
}