Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'transparent' in window setting #484

Merged
merged 3 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/window/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ pub struct Settings {
/// Whether the window should have a border, a title bar, etc. or not.
pub decorations: bool,

/// Whether the window should be transparent
pub transparent: bool,

/// The icon of the window.
pub icon: Option<Icon>,
}
Expand All @@ -30,6 +33,7 @@ impl Default for Settings {
max_size: None,
resizable: true,
decorations: true,
transparent: false,
icon: None,
}
}
Expand All @@ -44,6 +48,7 @@ impl From<Settings> for iced_winit::settings::Window {
max_size: settings.max_size,
resizable: settings.resizable,
decorations: settings.decorations,
transparent: settings.transparent,
icon: settings.icon.map(Icon::into),
platform_specific: Default::default(),
}
Expand Down
5 changes: 5 additions & 0 deletions winit/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ pub struct Window {
/// Whether the window should have a border, a title bar, etc.
pub decorations: bool,

/// Whether the window should be transparent
pub transparent: bool,

/// The window icon, which is also usually used in the taskbar
pub icon: Option<winit::window::Icon>,

Expand All @@ -69,6 +72,7 @@ impl Window {
.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));

Expand Down Expand Up @@ -103,6 +107,7 @@ impl Default for Window {
max_size: None,
resizable: true,
decorations: true,
transparent: false,
icon: None,
platform_specific: Default::default(),
}
Expand Down