Add WindowBuilder::with_active
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
parent
930df0ec45
commit
b457329003
9 changed files with 60 additions and 5 deletions
|
|
@ -139,6 +139,7 @@ pub(crate) struct WindowAttributes {
|
|||
pub content_protected: bool,
|
||||
pub window_level: WindowLevel,
|
||||
pub parent_window: Option<RawWindowHandle>,
|
||||
pub active: bool,
|
||||
}
|
||||
|
||||
impl Default for WindowAttributes {
|
||||
|
|
@ -163,6 +164,7 @@ impl Default for WindowAttributes {
|
|||
resize_increments: None,
|
||||
content_protected: false,
|
||||
parent_window: None,
|
||||
active: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -405,6 +407,22 @@ impl WindowBuilder {
|
|||
self
|
||||
}
|
||||
|
||||
/// Whether the window will be initially focused or not.
|
||||
///
|
||||
/// The window should be assumed as not focused by default
|
||||
/// following by the [`WindowEvent::Focused`].
|
||||
///
|
||||
/// ## Platform-specific:
|
||||
///
|
||||
/// **Android / iOS / X11 / Wayland / Orbital:** Unsupported.
|
||||
///
|
||||
/// [`WindowEvent::Focused`]: crate::event::WindowEvent::Focused.
|
||||
#[inline]
|
||||
pub fn with_active(mut self, active: bool) -> WindowBuilder {
|
||||
self.window.active = active;
|
||||
self
|
||||
}
|
||||
|
||||
/// Build window with parent window.
|
||||
///
|
||||
/// The default is `None`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue