Skip to main content

Theme

Struct Theme 

Source
pub struct Theme {
    pub info: ThemeInfo,
    pub inherits_from: Vec<Arc<Theme>>,
}
Expand description

An icon theme.

Fields§

§info: ThemeInfo

Properties of this theme and all of its subdirectories.

§inherits_from: Vec<Arc<Theme>>

References to the Themes that this theme depends on.

When querying for an icon that doesn’t exist in this theme, the themes in its inherits_from list will be checked for that icon instead.

Implementations§

Source§

impl Theme

Source

pub fn find_icon_unscaled(&self, icon_name: &str, size: u32) -> Option<IconFile>

Find an icon in this theme or any of its dependencies, with scale equal to 1.

Also see find_icon

Source

pub fn find_icon( &self, icon_name: &str, size: u32, scale: u32, ) -> Option<IconFile>

Find an icon in this theme or any of its dependencies.

This function seeks to replicate the behaviour from the official icon lookup mechanism from the Icon Theme specification, which you can find here.

Arguments:

  • icon_name: the canonical name of the icon without file extension.
  • size: the size, in pixels, desired. The returned icon may not be this exact size in case an exact match couldn’t be found.
  • scale: the scale at which the icon will be displayed.
Source

pub fn find_icon_here( &self, icon_name: &str, size: u32, scale: u32, ) -> Option<IconFile>

Find an icon in this theme only.

Do not use this function if you need normal icon finding behaviour: use find_icon instead.

Auto Trait Implementations§

§

impl Freeze for Theme

§

impl RefUnwindSafe for Theme

§

impl Send for Theme

§

impl Sync for Theme

§

impl Unpin for Theme

§

impl UnsafeUnpin for Theme

§

impl UnwindSafe for Theme

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