Skip to main content

TransientWindowConfig

Struct TransientWindowConfig 

Source
#[repr(C)]
pub struct TransientWindowConfig { pub size: OptionLogicalSize, pub anchor: TransientAnchor, pub dismiss: TransientDismiss, pub tearoff: TransientTearoff, pub dock: TransientDock, pub material: WindowBackgroundMaterial, pub open: bool, pub torn: bool, }
Expand description

The inline configuration of a NodeType::TransientWindow.

Copy and small on purpose: it rides inside NodeType the way GeolocationProbeConfig does, so opening a popup needs no allocation and NodeType (48 bytes, set by its largest payload) does not grow.

Fields§

§size: OptionLogicalSize

Explicit size, or None to size the window to its content - the common case, and the reason a colour picker never has to guess how tall its own panel is.

OptionLogicalSize, the #[repr(C, u8)] option, NOT Option<_>: this struct rides inside NodeType, which rides inside every Dom the C ABI passes by value, and a Rust Option has no stable layout - clippy’s improper_ctypes_definitions flagged every extern "C" fn -> Dom in the tree the moment a plain Option went in here.

§anchor: TransientAnchor

Which edge of the anchor (the node’s parent) it opens from.

§dismiss: TransientDismiss

What closes it.

§tearoff: TransientTearoff

Whether the user may drag the window OUT of its anchor into a free toplevel that is still the same DOM subtree (see TransientTearoff).

§dock: TransientDock

Popup at an anchor edge (the default), or inline content of its parent / drop zone that can be torn off and dropped elsewhere (dock="inline", see TransientDock).

§material: WindowBackgroundMaterial

The popup window’s background material (material="transparent"): Transparent gives the window per-pixel alpha, and its shape follows what the content paints - rounded corners are real corners, a pointer arrow is part of the window, a click beside it falls through. A clip mask on the node (set_clip_mask, the same mask any DOM node can carry) implies Transparent: the mask IS the window’s shape.

§open: bool

The ONLY thing an application toggles. true materialises the subtree as a window; false tears it down and drops it from layout entirely.

§torn: bool

The app’s word on whether the window is currently torn off. Like open, this is a REQUEST the engine follows on every change: flipping it true tears the window off at its anchor position, flipping it false docks it. In between, the user’s own drags win - a palette the user parked by the document does not snap back on the next layout just because the app still says torn="false". The app learns about user tear-offs through ComponentEventFilter::TornOff / Docked.

Implementations§

Source§

impl TransientWindowConfig

Source

pub const fn closed() -> Self

Closed, with every other field at its default.

Source

pub const fn opened() -> Self

Open, with every other field at its default.

Source

pub const fn with_anchor(self, anchor: TransientAnchor) -> Self

Source

pub const fn with_dismiss(self, dismiss: TransientDismiss) -> Self

Source

pub const fn with_size(self, size: LogicalSize) -> Self

Source

pub const fn with_tearoff(self, tearoff: TransientTearoff) -> Self

Source

pub const fn with_torn(self, torn: bool) -> Self

Source

pub const fn with_material(self, material: WindowBackgroundMaterial) -> Self

Source

pub const fn with_dock(self, dock: TransientDock) -> Self

Source§

impl TransientWindowConfig

Source

pub fn apply_attr(&mut self, key: &str, value: &str) -> bool

Apply one XML/HTML attribute. Returns true if the key was one of ours.

size="WxH" in logical px; anything else for a known key degrades to the default rather than erroring - a typo must not make a popup refuse to open. Unknown keys return false so the caller can treat them as ordinary attributes (id, class, …).

Trait Implementations§

Source§

impl Clone for TransientWindowConfig

Source§

fn clone(&self) -> TransientWindowConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TransientWindowConfig

Source§

impl Debug for TransientWindowConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TransientWindowConfig

Source§

fn default() -> Self

Closed, anchored below, dismissed by outside-click, content-sized.

Source§

impl Eq for TransientWindowConfig

Source§

impl Hash for TransientWindowConfig

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for TransientWindowConfig

Source§

fn cmp(&self, other: &TransientWindowConfig) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for TransientWindowConfig

Source§

fn eq(&self, other: &TransientWindowConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for TransientWindowConfig

Source§

fn partial_cmp(&self, other: &TransientWindowConfig) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for TransientWindowConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetHash for T
where T: Hash,

Source§

fn get_hash(&self) -> u64

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.