[]Struct gio::ThemedIcon

pub struct ThemedIcon(_, _);

ThemedIcon is an implementation of Icon that supports icon themes. ThemedIcon contains a list of all of the icons present in an icon theme, so that icons can be looked up quickly. ThemedIcon does not provide actual pixmaps for icons, just the icon names. Ideally something like gtk_icon_theme_choose_icon should be used to resolve the list of names so that fallback icons work nicely with themes that inherit other themes.

Implements

glib::object::ObjectExt, IconExt

Methods

impl ThemedIcon[src]

pub fn new(iconname: &str) -> ThemedIcon[src]

Creates a new themed icon for iconname.

iconname

a string containing an icon name.

Returns

a new ThemedIcon.

pub fn new_from_names(iconnames: &[&str]) -> ThemedIcon[src]

Creates a new themed icon for iconnames.

iconnames

an array of strings containing icon names.

len

the length of the iconnames array, or -1 if iconnames is None-terminated

Returns

a new ThemedIcon

pub fn new_with_default_fallbacks(iconname: &str) -> ThemedIcon[src]

Creates a new themed icon for iconname, and all the names that can be created by shortening iconname at '-' characters.

In the following example, icon1 and icon2 are equivalent:

const char *names[] = {
  "gnome-dev-cdrom-audio",
  "gnome-dev-cdrom",
  "gnome-dev",
  "gnome"
};

icon1 = g_themed_icon_new_from_names (names, 4);
icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");

iconname

a string containing an icon name

Returns

a new ThemedIcon.

pub fn append_name(&self, iconname: &str)[src]

Append a name to the list of icons from within self.

Note that doing so invalidates the hash computed by prior calls to Icon::hash.

iconname

name of icon to append to list of icons from within self.

pub fn get_names(&self) -> Vec<GString>[src]

Gets the names of icons from within self.

Returns

a list of icon names.

pub fn prepend_name(&self, iconname: &str)[src]

Prepend a name to the list of icons from within self.

Note that doing so invalidates the hash computed by prior calls to Icon::hash.

iconname

name of icon to prepend to list of icons from within self.

pub fn get_property_use_default_fallbacks(&self) -> bool[src]

Whether to use the default fallbacks found by shortening the icon name at '-' characters. If the "names" array has more than one element, ignores any past the first.

For example, if the icon name was "gnome-dev-cdrom-audio", the array would become

{
  "gnome-dev-cdrom-audio",
  "gnome-dev-cdrom",
  "gnome-dev",
  "gnome",
  NULL
};

pub fn connect_property_names_notify<F: Fn(&ThemedIcon) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Trait Implementations

impl Clone for ThemedIcon

impl Debug for ThemedIcon

impl Display for ThemedIcon[src]

impl Eq for ThemedIcon

impl Hash for ThemedIcon

impl IsA<Icon> for ThemedIcon

impl Ord for ThemedIcon

impl<T: ObjectType> PartialEq<T> for ThemedIcon

impl<T: ObjectType> PartialOrd<T> for ThemedIcon

impl StaticType for ThemedIcon

Auto Trait Implementations

impl RefUnwindSafe for ThemedIcon

impl !Send for ThemedIcon

impl !Sync for ThemedIcon

impl Unpin for ThemedIcon

impl UnwindSafe for ThemedIcon

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.