Skip to main content

CollectionBehavior

Struct CollectionBehavior 

Source
pub struct CollectionBehavior(/* private fields */);
Expand description

Window collection behavior builder for NSPanel

Allows combining multiple collection behaviors using the builder pattern. Collection behaviors control how a window participates in Spaces, Exposé, and fullscreen mode.

§Example

use tauri::AppHandle;
use tauri_nspanel::{tauri_panel, CollectionBehavior, PanelBuilder};

tauri_panel! {
    panel!(SpacesPanel {})
}


// Create a panel that appears on all spaces and ignores Cmd+Tab cycling
let behavior = CollectionBehavior::new()
    .can_join_all_spaces()
    .ignores_cycle();

// Use with PanelBuilder
let _panel = PanelBuilder::<_, SpacesPanel>::new(app, "my-panel")
    .collection_behavior(behavior)
    .build()?;

Implementations§

Source§

impl CollectionBehavior

Source

pub fn new() -> Self

Create an empty collection behavior

Source

pub fn can_join_all_spaces(self) -> Self

Window can be shown on another space

Source

pub fn move_to_active_space(self) -> Self

Window appears in all spaces

Source

pub fn managed(self) -> Self

Window is managed by Spaces

Source

pub fn transient(self) -> Self

Window participates in Spaces and Expose

Source

pub fn stationary(self) -> Self

Window does not participate in Spaces or Expose

Source

pub fn participates_in_cycle(self) -> Self

Window participates in cycling

Source

pub fn ignores_cycle(self) -> Self

Window ignores cycling commands

Source

pub fn full_screen_primary(self) -> Self

Window can be shown in full screen

Source

pub fn full_screen_auxiliary(self) -> Self

Window can be shown alongside full screen window

Source

pub fn full_screen_none(self) -> Self

Window does not allow full screen

Source

pub fn full_screen_allows_tiling(self) -> Self

Window can be shown in full screen for this space only

Source

pub fn full_screen_disallows_tiling(self) -> Self

Window does not allow full screen and hides on app deactivation

Source

pub fn from_raw(flags: NSWindowCollectionBehavior) -> Self

Create from raw NSWindowCollectionBehavior flags

Source

pub fn value(&self) -> NSWindowCollectionBehavior

Get the raw NSWindowCollectionBehavior flags

Trait Implementations§

Source§

impl Clone for CollectionBehavior

Source§

fn clone(&self) -> CollectionBehavior

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 CollectionBehavior

Source§

impl Debug for CollectionBehavior

Source§

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

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

impl Default for CollectionBehavior

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<CollectionBehavior> for NSWindowCollectionBehavior

Source§

fn from(behavior: CollectionBehavior) -> Self

Converts to this type from the input type.
Source§

impl From<NSWindowCollectionBehavior> for CollectionBehavior

Source§

fn from(value: NSWindowCollectionBehavior) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CollectionBehavior

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CollectionBehavior

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> AutoreleaseSafe for T
where T: ?Sized,

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, 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,