Skip to main content

MimickTray

Struct MimickTray 

Source
pub struct MimickTray {
    pub settings_tx: Sender<bool>,
    pub library_tx: Sender<bool>,
    pub quit_tx: Sender<bool>,
    pub pause_tx: Sender<bool>,
    pub sync_now_tx: Sender<bool>,
    pub library_view_enabled: bool,
}
Expand description

Represents the tray state shared with ksni menu callbacks and GTK main loop.

Fields§

§settings_tx: Sender<bool>

Sender used to signal the GTK main loop to open the settings window. Sending true triggers the open; the receiver is polled via glib::timeout_add.

§library_tx: Sender<bool>

Sender used to signal the GTK main loop to open the library window.

§quit_tx: Sender<bool>

Sender used to request a graceful application quit from the GTK main loop.

§pause_tx: Sender<bool>

Sender used to toggle the paused state from the tray.

§sync_now_tx: Sender<bool>

Sender used to request an immediate catch-up scan.

§library_view_enabled: bool

Cached from Config at tray construction to avoid disk I/O per menu open.

Trait Implementations§

Source§

impl Debug for MimickTray

Source§

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

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

impl Tray for MimickTray

Source§

fn id(&self) -> String

It’s a name that should be unique for this application and consistent between sessions, such as the application name itself. Read more
Source§

fn icon_name(&self) -> String

The item only support the context menu, the visualization should prefer showing the menu or sending ContextMenu() instead of Activate() The StatusNotifierItem can carry an icon that can be used by the visualization to identify the item.
Source§

fn title(&self) -> String

It’s a name that describes the application, it can be more descriptive than Id.
Source§

fn menu(&self) -> Vec<MenuItem<Self>>

The menu you want to display Read more
§

const MENU_ON_ACTIVATE: bool = false

Replaces the default activate behavior with opening the menu Read more
§

fn activate(&mut self, _x: i32, _y: i32)

Asks the status notifier item for activation, this is typically a consequence of user input, such as mouse left click over the graphical representation of the item. The application will perform any task is considered appropriate as an activation request. Read more
§

fn secondary_activate(&mut self, _x: i32, _y: i32)

Is to be considered a secondary and less important form of activation compared to Activate. This is typically a consequence of user input, such as mouse middle click over the graphical representation of the item. The application will perform any task is considered appropriate as an activation request. Read more
§

fn scroll(&mut self, _delta: i32, _orientation: Orientation)

The user asked for a scroll action. This is caused from input such as mouse wheel over the graphical representation of the item. Read more
§

fn category(&self) -> Category

Describes the category of this item.
§

fn status(&self) -> Status

Describes the status of this item or of the associated application.
§

fn window_id(&self) -> i32

It’s the windowing-system dependent identifier for a window, the application can chose one of its windows to be available through this property or just set 0 if it’s not interested.
§

fn icon_theme_path(&self) -> String

An additional path to add to the theme search path to find the icons.
§

fn icon_pixmap(&self) -> Vec<Icon>

Carries an ARGB32 binary representation of the icon
§

fn overlay_icon_name(&self) -> String

The Freedesktop-compliant name of an icon. This can be used by the visualization to indicate extra state information, for instance as an overlay for the main icon.
§

fn overlay_icon_pixmap(&self) -> Vec<Icon>

ARGB32 binary representation of the overlay icon described in the previous paragraph.
§

fn attention_icon_name(&self) -> String

The Freedesktop-compliant name of an icon. this can be used by the visualization to indicate that the item is in RequestingAttention state.
§

fn attention_icon_pixmap(&self) -> Vec<Icon>

ARGB32 binary representation of the requesting attention icon describe in the previous paragraph.
§

fn attention_movie_name(&self) -> String

An item can also specify an animation associated to the RequestingAttention state. This should be either a Freedesktop-compliant icon name or a full path. The visualization can chose between the movie or AttentionIconPixmap (or using neither of those) at its discretion.
§

fn tool_tip(&self) -> ToolTip

Data structure that describes extra information associated to this item, that can be visualized for instance by a tooltip (or by any other mean the visualization consider appropriate.
§

fn text_direction(&self) -> TextDirection

Represents the way the text direction of the application. This allows the server to handle mismatches intelligently.
§

fn menu_about_to_show(&mut self)

The root menu is about to show Read more
§

fn watcher_online(&self)

The org.kde.StatusNotifierWatcher is back to online Read more
§

fn watcher_offline(&self, reason: OfflineReason) -> bool

The org.kde.StatusNotifierWatcher is offline 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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> TrayMethods for T
where T: Tray,

§

async fn spawn(self) -> Result<Handle<Self>, Error>

Run the tray service in background Read more
§

fn disable_dbus_name(self, disable: bool) -> TrayServiceBuilder<Self>

Disable owning a D-Bus well-known name (StatusNotifierItem-PID-ID) for the tray service Read more
§

fn assume_sni_available( self, assume_available: bool, ) -> TrayServiceBuilder<Self>

Assume the system has a working StatusNotifierItem implementation 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> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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