Exposing winit decorations (#627)

Exposing winit decorations
This commit is contained in:
Downtime 2020-10-06 01:51:36 +08:00 committed by GitHub
parent 219527ed7d
commit 125afb41ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -39,6 +39,7 @@ pub struct Window {
pub title: String, pub title: String,
pub vsync: bool, pub vsync: bool,
pub resizable: bool, pub resizable: bool,
pub decorations: bool,
pub mode: WindowMode, pub mode: WindowMode,
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
pub canvas: Option<String>, pub canvas: Option<String>,
@ -65,6 +66,7 @@ impl Window {
title: window_descriptor.title.clone(), title: window_descriptor.title.clone(),
vsync: window_descriptor.vsync, vsync: window_descriptor.vsync,
resizable: window_descriptor.resizable, resizable: window_descriptor.resizable,
decorations: window_descriptor.decorations,
mode: window_descriptor.mode, mode: window_descriptor.mode,
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
canvas: window_descriptor.canvas.clone(), canvas: window_descriptor.canvas.clone(),
@ -80,6 +82,7 @@ pub struct WindowDescriptor {
pub title: String, pub title: String,
pub vsync: bool, pub vsync: bool,
pub resizable: bool, pub resizable: bool,
pub decorations: bool,
pub mode: WindowMode, pub mode: WindowMode,
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
pub canvas: Option<String>, pub canvas: Option<String>,
@ -98,6 +101,7 @@ impl Default for WindowDescriptor {
height: 720, height: 720,
vsync: true, vsync: true,
resizable: true, resizable: true,
decorations: true,
mode: WindowMode::Windowed, mode: WindowMode::Windowed,
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
canvas: None, canvas: None,

View File

@ -35,7 +35,8 @@ impl WinitWindows {
)), )),
_ => winit_window_builder _ => winit_window_builder
.with_inner_size(winit::dpi::PhysicalSize::new(window.width, window.height)) .with_inner_size(winit::dpi::PhysicalSize::new(window.width, window.height))
.with_resizable(window.resizable), .with_resizable(window.resizable)
.with_decorations(window.decorations),
}; };
#[allow(unused_mut)] #[allow(unused_mut)]