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

View file

@ -35,7 +35,8 @@ impl WinitWindows {
)),
_ => winit_window_builder
.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)]