Gio.ThemedIcon¶
| Subclasses: | None |
|---|
Methods¶
| Inherited: | GObject.Object (37), Gio.Icon (6) |
|---|---|
| Structs: | GObject.ObjectClass (5) |
| class | new (iconname) |
| class | new_from_names (iconnames) |
| class | new_with_default_fallbacks (iconname) |
append_name (iconname) |
|
get_names () |
|
prepend_name (iconname) |
Virtual Methods¶
| Inherited: | GObject.Object (7), Gio.Icon (3) |
|---|
Properties¶
| Name | Type | Flags | Short Description |
|---|---|---|---|
name |
str |
w/co | The name of the icon |
names |
[str] |
r/w/co | An array containing the icon names |
use-default-fallbacks |
bool |
r/w/co | Whether to use default fallbacks found by shortening the name at “-” characters. Ignores names after the first if multiple names are given. |
Signals¶
| Inherited: | GObject.Object (1) |
|---|
Fields¶
| Inherited: | GObject.Object (1) |
|---|
Class Details¶
-
class
Gio.ThemedIcon(**kwargs)¶ Bases: GObject.Object,Gio.IconAbstract: No Structure: Gio.ThemedIconClassGio.ThemedIconis an implementation ofGio.Iconthat supports icon themes.Gio.ThemedIconcontains a list of all of the icons present in an icon theme, so that icons can be looked up quickly.Gio.ThemedIcondoes 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.-
classmethod
new(iconname)[source]¶ Parameters: iconname ( str) – a string containing an icon name.Returns: a new Gio.ThemedIcon.Return type: Gio.ThemedIconCreates a new themed icon for iconname.
-
classmethod
new_from_names(iconnames)[source]¶ Parameters: iconnames ([ str]) – an array of strings containing icon names.Returns: a new Gio.ThemedIconReturn type: Gio.ThemedIconCreates a new themed icon for iconnames.
-
classmethod
new_with_default_fallbacks(iconname)[source]¶ Parameters: iconname ( str) – a string containing an icon nameReturns: a new Gio.ThemedIcon.Return type: Gio.ThemedIconCreates 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");
-
append_name(iconname)[source]¶ Parameters: iconname ( str) – name of icon to append to list of icons from within self.Append a name to the list of icons from within self.
Note that doing so invalidates the hash computed by prior calls to
Gio.Icon.hash().
-
get_names()[source]¶ Returns: a list of icon names. Return type: [ str]Gets the names of icons from within self.
-
prepend_name(iconname)[source]¶ Parameters: iconname ( str) – name of icon to prepend to list of icons from within self.Prepend a name to the list of icons from within self.
Note that doing so invalidates the hash computed by prior calls to
Gio.Icon.hash().New in version 2.18.
-
classmethod
Property Details¶
-
Gio.ThemedIcon.props.name¶ Name: nameType: strDefault Value: NoneFlags: WRITABLE,CONSTRUCT_ONLYThe icon name.
-
Gio.ThemedIcon.props.names¶ Name: namesType: [ str]Default Value: []Flags: READABLE,WRITABLE,CONSTRUCT_ONLYA
None-terminated array of icon names.
-
Gio.ThemedIcon.props.use_default_fallbacks¶ Name: use-default-fallbacksType: boolDefault Value: FalseFlags: READABLE,WRITABLE,CONSTRUCT_ONLYWhether 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 };