Remove window::Mode and introduce Settings::visible
Additionally, only show the window once one frame has been rendered to avoid blank flashes on Windows.
This commit is contained in:
parent
07cbed1064
commit
277b848ad8
11 changed files with 52 additions and 121 deletions
|
|
@ -1,12 +0,0 @@
|
|||
/// The mode of a window-based application.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Mode {
|
||||
/// The application appears in its own window.
|
||||
Windowed,
|
||||
|
||||
/// The application takes the whole screen of its current monitor.
|
||||
Fullscreen,
|
||||
|
||||
/// The application is hidden
|
||||
Hidden,
|
||||
}
|
||||
|
|
@ -15,6 +15,9 @@ pub struct Settings {
|
|||
/// The maximum size of the window.
|
||||
pub max_size: Option<(u32, u32)>,
|
||||
|
||||
/// Whether the window should be visible or not.
|
||||
pub visible: bool,
|
||||
|
||||
/// Whether the window should be resizable or not.
|
||||
pub resizable: bool,
|
||||
|
||||
|
|
@ -38,6 +41,7 @@ impl Default for Settings {
|
|||
position: Position::default(),
|
||||
min_size: None,
|
||||
max_size: None,
|
||||
visible: true,
|
||||
resizable: true,
|
||||
decorations: true,
|
||||
transparent: false,
|
||||
|
|
@ -54,6 +58,7 @@ impl From<Settings> for iced_winit::settings::Window {
|
|||
position: iced_winit::Position::from(settings.position),
|
||||
min_size: settings.min_size,
|
||||
max_size: settings.max_size,
|
||||
visible: settings.visible,
|
||||
resizable: settings.resizable,
|
||||
decorations: settings.decorations,
|
||||
transparent: settings.transparent,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue