Skip to main content

TrayHost

Struct TrayHost 

Source
pub struct TrayHost { /* private fields */ }
Expand description

The tray, from cx.tray(). A clone is cheap and shares the one connection.

Implementations§

Source§

impl TrayHost

Source

pub fn items(&self) -> ReadSignal<Vec<TrayItem>>

Every item, in the order they registered. Empty while there is no session bus. An item shows once its properties are read.

Source

pub fn activate(&self, id: &str)

Tells item id it was clicked, as a left click does. A Wayland client can’t know where on screen that was, so the item is told (0, 0). A refusal or an unknown id is logged.

Source

pub fn secondary_activate(&self, id: &str)

Tells item id it was middle-clicked, as for activate.

Source

pub fn scroll(&self, id: &str, steps: i32)

Tells item id the wheel turned steps, positive for up, as a button’s on_scroll gives them.

Source

pub fn menu(&self) -> ReadSignal<Option<TrayMenu>>

The tray menu that is open, if any. One is open at a time: opening another closes it. It is None from open_menu until the app’s layout arrives, and follows the app’s changes while it stays open.

Source

pub fn open_menu(&self, id: &str)

Opens item id’s menu: tells the app, as a right click does, then reads the layout into menu. An item with no menu, or an unknown id, is logged.

Source

pub fn open_submenu(&self, entry: i32)

Tells the open menu’s app that its submenu entry opens, as a nested popup does. An app that fills submenus only then sends the entries, and menu shows them.

Source

pub fn close_menu(&self)

Closes the open menu and stops following it.

Source

pub fn menu_event(&self, id: &str, entry: i32)

Tells item id its menu entry entry was clicked. A refusal or an unknown id is logged.

Trait Implementations§

Source§

impl Clone for TrayHost

Source§

fn clone(&self) -> Self

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

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more