Add symbolic icons to TextureCache's load_icon_name()

Icons can be loaded as St.Icon.SYMBOLIC, FULLCOLOR, APPLICATION or
DOCUMENT. The first will look for a symbolic equivalent, the second
looks for a full-color version (and does fallback, eg, from
"drive-harddisk-usb" to "drive-harddisk"). APPLICATION and DOCUMENT do
full-color icons without fallback (as specified by the icon spec).

And update various callers to use the right flags.

Based on a patch from Matt Novenstern.

https://bugzilla.gnome.org/show_bug.cgi?id=621311
This commit is contained in:
Dan Winship
2010-09-16 11:04:51 -04:00
parent 4b781ae7e6
commit a6e4bab990
10 changed files with 86 additions and 21 deletions

View File

@ -148,7 +148,7 @@ NotificationDaemon.prototype = {
let uri = GLib.filename_to_uri(icon, null);
return textureCache.load_uri_async(uri, size, size);
} else
return textureCache.load_icon_name(icon, size);
return textureCache.load_icon_name(icon, St.IconType.FULLCOLOR, size);
} else if (hints.icon_data) {
let [width, height, rowStride, hasAlpha,
bitsPerSample, nChannels, data] = hints.icon_data;
@ -165,7 +165,7 @@ NotificationDaemon.prototype = {
stockIcon = 'gtk-dialog-error';
break;
}
return textureCache.load_icon_name(stockIcon, size);
return textureCache.load_icon_name(stockIcon, St.IconType.FULLCOLOR, size);
}
},