summaryrefslogtreecommitdiffstats
path: root/winit
diff options
context:
space:
mode:
authorLibravatar Katherine Philip <kurerunoshikaku@yahoo.com>2020-08-17 15:38:02 +0700
committerLibravatar Katherine Philip <kurerunoshikaku@yahoo.com>2020-08-17 15:42:50 +0700
commita490fd54c9b262c9d8ac946f75a0016fbb81848b (patch)
tree1c11e7b793abb0615d32d1e2cc576c238e1de2f4 /winit
parent00d66da0cee1dc7faeccc5b3f0794a0393a38da7 (diff)
downloadiced-a490fd54c9b262c9d8ac946f75a0016fbb81848b.tar.gz
iced-a490fd54c9b262c9d8ac946f75a0016fbb81848b.tar.bz2
iced-a490fd54c9b262c9d8ac946f75a0016fbb81848b.zip
Add 'transparent' in window setting
Diffstat (limited to 'winit')
-rw-r--r--winit/src/settings.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/winit/src/settings.rs b/winit/src/settings.rs
index 4155bf7d..418c7582 100644
--- a/winit/src/settings.rs
+++ b/winit/src/settings.rs
@@ -45,6 +45,8 @@ pub struct Window {
/// Whether the window should have a border, a title bar, etc.
pub decorations: bool,
+ pub transparent: bool,
+
/// The window icon, which is also usually used in the taskbar
pub icon: Option<winit::window::Icon>,
@@ -64,11 +66,13 @@ impl Window {
let (width, height) = self.size;
+ println!("patched window with trasparent");
window_builder = window_builder
.with_title(title)
.with_inner_size(winit::dpi::LogicalSize { width, height })
.with_resizable(self.resizable)
.with_decorations(self.decorations)
+ .with_transparent(self.transparent)
.with_window_icon(self.icon)
.with_fullscreen(conversion::fullscreen(primary_monitor, mode));
@@ -83,13 +87,13 @@ impl Window {
}
#[cfg(target_os = "windows")]
- {
- use winit::platform::windows::WindowBuilderExtWindows;
+ {
+ use winit::platform::windows::WindowBuilderExtWindows;
- if let Some(parent) = self.platform_specific.parent {
- window_builder = window_builder.with_parent_window(parent);
+ if let Some(parent) = self.platform_specific.parent {
+ window_builder = window_builder.with_parent_window(parent);
+ }
}
- }
window_builder
}
@@ -103,6 +107,7 @@ impl Default for Window {
max_size: None,
resizable: true,
decorations: true,
+ transparent: false,
icon: None,
platform_specific: Default::default(),
}