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::Size;
28use crate::window::{Icon, Level, Position};
29
30pub use platform::PlatformSpecific;
31
32#[derive(Debug, Clone)]
34pub struct Settings {
35 pub size: Size,
37
38 pub maximized: bool,
40
41 pub fullscreen: bool,
43
44 pub position: Position,
46
47 pub min_size: Option<Size>,
49
50 pub max_size: Option<Size>,
52
53 pub visible: bool,
55
56 pub resizable: bool,
58
59 pub decorations: bool,
61
62 pub transparent: bool,
64
65 pub level: Level,
67
68 pub icon: Option<Icon>,
70
71 pub platform_specific: PlatformSpecific,
73
74 pub exit_on_close_request: bool,
83}
84
85impl Default for Settings {
86 fn default() -> Self {
87 Self {
88 size: Size::new(1024.0, 768.0),
89 maximized: false,
90 fullscreen: false,
91 position: Position::default(),
92 min_size: None,
93 max_size: None,
94 visible: true,
95 resizable: true,
96 decorations: true,
97 transparent: false,
98 level: Level::default(),
99 icon: None,
100 exit_on_close_request: true,
101 platform_specific: PlatformSpecific::default(),
102 }
103 }
104}