#[non_exhaustive]pub struct WindowAttributes {Show 25 fields
pub title: Option<String>,
pub title_bar: Option<TitleBarOptions>,
pub frame: Option<WindowFrameStyle>,
pub min_size: Option<Option<Size<Points>>>,
pub max_size: Option<Option<Size<Points>>>,
pub aspect_ratio: Option<Option<f32>>,
pub size_to_content: Option<SizeToContent>,
pub resizable: Option<bool>,
pub movable: Option<bool>,
pub minimizable: Option<bool>,
pub maximizable: Option<bool>,
pub closable: Option<bool>,
pub focusable: Option<bool>,
pub activate: Option<bool>,
pub close_on_press: Option<bool>,
pub close_on_escape: Option<bool>,
pub close_on_blur: Option<bool>,
pub level: Option<WindowLevel>,
pub taskbar: Option<bool>,
pub workspaces: Option<Workspaces>,
pub pointer_events: Option<WindowPointerEvents>,
pub transparent: Option<bool>,
pub backdrop: Option<Backdrop>,
pub shadow: Option<bool>,
pub progress: Option<Option<WindowProgress>>,
}Expand description
What only the app changes of a window (TS WindowAttributes):
<Window>’s reactive props, WindowRef.set()’s argument, and
the diff the core sends the platform. Every field is optional:
one left out is not changed. A window’s kind gives every
attribute a default (WindowAttributes::for_kind).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.title: Option<String>Shown in the title bar, the taskbar, the window switcher and to assistive technologies.
title_bar: Option<TitleBarOptions>The title bar: the system’s, or hidden for one the app draws.
frame: Option<WindowFrameStyle>The system’s frame (title bar and border), or none.
min_size: Option<Option<Size<Points>>>The least size the user may give it (content size, points).
max_size: Option<Option<Size<Points>>>The largest size the user may give it (content size, points).
aspect_ratio: Option<Option<f32>>The ratio of width to height the user’s resizes keep its content
at (16 / 9); the app’s own setBounds is not limited.
size_to_content: Option<SizeToContent>The window follows its content’s laid-out size.
resizable: Option<bool>The user may resize it.
movable: Option<bool>The user may move it.
minimizable: Option<bool>The user may minimize it.
maximizable: Option<bool>The user may maximize it.
closable: Option<bool>The user may close it.
focusable: Option<bool>It takes the keyboard focus.
activate: Option<bool>It activates (and takes the focus) when it opens or shows.
close_on_press: Option<bool>A press of its close button (or the close key) closes it at once;
false: the app hears closePress and closes it when it decides.
close_on_escape: Option<bool>Escape closes it.
close_on_blur: Option<bool>Losing the focus closes it.
level: Option<WindowLevel>How high it floats.
taskbar: Option<bool>It shows in the taskbar.
workspaces: Option<Workspaces>The workspaces it shows on.
pointer_events: Option<WindowPointerEvents>Whether it takes the pointer.
transparent: Option<bool>Its background is transparent.
backdrop: Option<Backdrop>The system material behind its content.
shadow: Option<bool>The system’s shadow around it.
progress: Option<Option<WindowProgress>>Progress on its taskbar button or the Dock’s icon.
Implementations§
Source§impl WindowAttributes
impl WindowAttributes
Sourcepub fn merge(&mut self, other: &WindowAttributes)
pub fn merge(&mut self, other: &WindowAttributes)
Sets the fields other sets.
Sourcepub fn diff(&self, next: &WindowAttributes) -> Option<WindowAttributes>
pub fn diff(&self, next: &WindowAttributes) -> Option<WindowAttributes>
The fields of next that differ from self (what was sent):
None when nothing does.
Source§impl WindowAttributes
impl WindowAttributes
Sourcepub fn for_kind(kind: WindowKind) -> WindowAttributes
pub fn for_kind(kind: WindowKind) -> WindowAttributes
Every attribute’s default for a window of kind: what a window
opened with no attributes of its own has.
Sourcepub fn resolve(kind: WindowKind, own: &WindowAttributes) -> WindowAttributes
pub fn resolve(kind: WindowKind, own: &WindowAttributes) -> WindowAttributes
The attributes of a window of kind given own: the kind’s
defaults with own’s fields over them.
Sourcepub fn passes_pointer(&self) -> bool
pub fn passes_pointer(&self) -> bool
Whether these make the window an overlay’s: click-through
(pointerEvents: "none", or "box-none" where nothing in it takes
the pointer), which the windows capability’s overlay grants.
Trait Implementations§
Source§impl Clone for WindowAttributes
impl Clone for WindowAttributes
Source§impl Debug for WindowAttributes
impl Debug for WindowAttributes
Source§impl Default for WindowAttributes
impl Default for WindowAttributes
Source§impl IntoReactive<WindowAttributes> for WindowAttributes
impl IntoReactive<WindowAttributes> for WindowAttributes
Source§fn into_reactive(self) -> Reactive<WindowAttributes>
fn into_reactive(self) -> Reactive<WindowAttributes>
Reactive.Source§impl JsValue for WindowAttributes
TS: WindowAttributes (declared by nsh/desktop), a partial
one: left-out keys are unchanged, null clears a nullable one.
impl JsValue for WindowAttributes
TS: WindowAttributes (declared by nsh/desktop), a partial
one: left-out keys are unchanged, null clears a nullable one.
Source§impl PartialEq for WindowAttributes
impl PartialEq for WindowAttributes
impl StructuralPartialEq for WindowAttributes
Auto Trait Implementations§
impl Forget for WindowAttributes
impl Freeze for WindowAttributes
impl Move for WindowAttributes
impl RefUnwindSafe for WindowAttributes
impl Send for WindowAttributeswhere
RawVecInner: Send,
impl Sync for WindowAttributeswhere
RawVecInner: Sync,
impl Unpin for WindowAttributes
impl UnsafeUnpin for WindowAttributes
impl UnwindSafe for WindowAttributeswhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CallbackArgs for Twhere
T: Ret,
impl<T> CallbackArgs for Twhere
T: Ret,
Source§fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
names (name: string, amount: number), or without names value for one and a, b, … for
several.