Add decorations to Setting
This commit is contained in:
parent
811d8b90d7
commit
f0a857ddde
3 changed files with 10 additions and 0 deletions
|
|
@ -19,6 +19,9 @@ pub struct Window {
|
||||||
|
|
||||||
/// Whether the window should be resizable or not.
|
/// Whether the window should be resizable or not.
|
||||||
pub resizable: bool,
|
pub resizable: bool,
|
||||||
|
|
||||||
|
/// Whether the window should have a border, a title bar, etc.
|
||||||
|
pub decorations: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Window {
|
impl Default for Window {
|
||||||
|
|
@ -26,6 +29,7 @@ impl Default for Window {
|
||||||
Window {
|
Window {
|
||||||
size: (1024, 768),
|
size: (1024, 768),
|
||||||
resizable: true,
|
resizable: true,
|
||||||
|
decorations: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -37,6 +41,7 @@ impl From<Settings> for iced_winit::Settings {
|
||||||
window: iced_winit::settings::Window {
|
window: iced_winit::settings::Window {
|
||||||
size: settings.window.size,
|
size: settings.window.size,
|
||||||
resizable: settings.window.resizable,
|
resizable: settings.window.resizable,
|
||||||
|
decorations: settings.window.decorations,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ pub trait Application: Sized {
|
||||||
height: f64::from(height),
|
height: f64::from(height),
|
||||||
})
|
})
|
||||||
.with_resizable(settings.window.resizable)
|
.with_resizable(settings.window.resizable)
|
||||||
|
.with_decorations(settings.window.decorations)
|
||||||
.build(&event_loop)
|
.build(&event_loop)
|
||||||
.expect("Open window");
|
.expect("Open window");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ pub struct Window {
|
||||||
|
|
||||||
/// Whether the window should be resizable or not.
|
/// Whether the window should be resizable or not.
|
||||||
pub resizable: bool,
|
pub resizable: bool,
|
||||||
|
|
||||||
|
/// Whether the window should have a border, a title bar, etc.
|
||||||
|
pub decorations: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Window {
|
impl Default for Window {
|
||||||
|
|
@ -24,6 +27,7 @@ impl Default for Window {
|
||||||
Window {
|
Window {
|
||||||
size: (1024, 768),
|
size: (1024, 768),
|
||||||
resizable: true,
|
resizable: true,
|
||||||
|
decorations: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue