1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use crate::window::Icon;
#[derive(Debug, Clone)]
pub struct Settings {
pub size: (u32, u32),
pub min_size: Option<(u32, u32)>,
pub max_size: Option<(u32, u32)>,
pub resizable: bool,
pub decorations: bool,
pub transparent: bool,
pub icon: Option<Icon>,
}
impl Default for Settings {
fn default() -> Settings {
Settings {
size: (1024, 768),
min_size: None,
max_size: None,
resizable: true,
decorations: true,
transparent: false,
icon: None,
}
}
}
#[cfg(not(target_arch = "wasm32"))]
impl From<Settings> for iced_winit::settings::Window {
fn from(settings: Settings) -> Self {
Self {
size: settings.size,
min_size: settings.min_size,
max_size: settings.max_size,
resizable: settings.resizable,
decorations: settings.decorations,
transparent: settings.transparent,
icon: settings.icon.map(Icon::into),
platform_specific: Default::default(),
}
}
}