iced_core/window/
settings.rs1#[cfg(target_os = "windows")]
3#[path = "settings/windows.rs"]
4mod platform;
5
6#[cfg(target_os = "macos")]
7#[path = "settings/macos.rs"]
8mod platform;
9
10#[cfg(target_os = "linux")]
11#[path = "settings/linux.rs"]
12mod platform;
13
14#[cfg(target_arch = "wasm32")]
15#[path = "settings/wasm.rs"]
16mod platform;
17
18#[cfg(not(any(
19 target_os = "windows",
20 target_os = "macos",
21 target_os = "linux",
22 target_arch = "wasm32"
23)))]
24#[path = "settings/other.rs"]
25mod platform;
26
27use crate::window::{Icon, Level, Position};
28use crate::Size;
29
30pub use platform::PlatformSpecific;
31#[derive(Debug, Clone)]
33pub struct Settings {
34 pub size: Size,
36
37 pub position: Position,
39
40 pub min_size: Option<Size>,
42
43 pub max_size: Option<Size>,
45
46 pub visible: bool,
48
49 pub resizable: bool,
51
52 pub decorations: bool,
54
55 pub transparent: bool,
57
58 pub level: Level,
60
61 pub icon: Option<Icon>,
63
64 pub platform_specific: PlatformSpecific,
66
67 pub exit_on_close_request: bool,
76}
77
78impl Default for Settings {
79 fn default() -> Self {
80 Self {
81 size: Size::new(1024.0, 768.0),
82 position: Position::default(),
83 min_size: None,
84 max_size: None,
85 visible: true,
86 resizable: true,
87 decorations: true,
88 transparent: false,
89 level: Level::default(),
90 icon: None,
91 exit_on_close_request: true,
92 platform_specific: PlatformSpecific::default(),
93 }
94 }
95}