pub struct CursorTheme { /* private fields */ }Expand description
A cursor theme.
Implementations§
Source§impl CursorTheme
impl CursorTheme
Sourcepub fn load(name: &str) -> Self
pub fn load(name: &str) -> Self
Search for a theme with the given name in the given search paths, and returns an XCursorTheme which represents it. If no inheritance can be determined, then the themes inherits from the “default” theme.
Sourcepub fn load_icon(&self, icon_name: &str) -> Option<PathBuf>
pub fn load_icon(&self, icon_name: &str) -> Option<PathBuf>
Try to load an icon from the theme. If the icon is not found within this theme’s directories, then the function looks at the theme from which this theme is inherited.
Sourcepub fn load_icon_with_depth(&self, icon_name: &str) -> Option<(PathBuf, usize)>
pub fn load_icon_with_depth(&self, icon_name: &str) -> Option<(PathBuf, usize)>
Try to load an icon from the theme, returning it with its inheritance depth.
If the icon is not found within this theme’s directories, then the function looks at the theme from which this theme is inherited. The second element of the returned tuple indicates how many levels of inheritance were traversed before the icon was found.
Sourcepub fn load_scalable(&self, icon_name: &str) -> Option<PathBuf>
pub fn load_scalable(&self, icon_name: &str) -> Option<PathBuf>
Try to load a scalable (SVG) cursor from the theme.
Returns the path to the cursor’s directory within cursors_scalable,
which contains a metadata.json and one or more SVG files. Theme
inheritance is followed exactly as in CursorTheme::load_icon.
Reading metadata.json and rendering the SVGs is left to the caller
Sourcepub fn load_scalable_with_depth(
&self,
icon_name: &str,
) -> Option<(PathBuf, usize)>
pub fn load_scalable_with_depth( &self, icon_name: &str, ) -> Option<(PathBuf, usize)>
Like CursorTheme::load_scalable, but also returns the number of
inheritance levels traversed before the cursor was found.
Trait Implementations§
Source§impl Clone for CursorTheme
impl Clone for CursorTheme
Source§fn clone(&self) -> CursorTheme
fn clone(&self) -> CursorTheme
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more