gnome/extensions/dash-to-dock@micxgx.gmail.com/appIconIndicators.js
/**
     * Try to get the pixel buffer for the current icon, if not fail gracefully
     */
Try to get the pixel buffer for the current icon, if not fail gracefully
Try to get the pixel buffer for the current icon if not fail gracefully
_getIconPixBuf() {
        let iconTexture = this._app.create_icon_texture(16);
        if (themeLoader === null) {
            let ifaceSettings = new Gio.Settings({ schema: "org.gnome.desktop.interface" });
            themeLoader = new Gtk.IconTheme(),
            themeLoader.set_custom_theme(ifaceSettings.get_string('icon-theme')); 
        }
        if (iconTexture instanceof St.Icon === false) {
            return null;
        }
        iconTexture = iconTexture.get_gicon();
        if (iconTexture === null) {
            return null;
        }
        if (iconTexture instanceof Gio.FileIcon) {
            return GdkPixbuf.Pixbuf.new_from_file(iconTexture.get_file().get_path());
        }
        let icon_info = themeLoader.lookup_icon(iconTexture.get_names()[0], DOMINANT_COLOR_ICON_SIZE, 0);
        if (icon_info !== null)
            return icon_info.load_icon();
        else
            return null;
    }
_getIconPixBuf ( ) { let iconTexture = this . _app . create_icon_texture ( 16 ) ; if ( themeLoader === null ) { let ifaceSettings = new Gio . Settings ( { schema : "org.gnome.desktop.interface" } ) ; themeLoader = new Gtk . IconTheme ( ) , themeLoader . set_custom_theme ( ifaceSettings . get_string ( 'icon-theme' ) ) ; } if ( iconTexture instanceof St . Icon === false ) { return null ; } iconTexture = iconTexture . get_gicon ( ) ; if ( iconTexture === null ) { return null ; } if ( iconTexture instanceof Gio . FileIcon ) { return GdkPixbuf . Pixbuf . new_from_file ( iconTexture . get_file ( ) . get_path ( ) ) ; } let icon_info = themeLoader . lookup_icon ( iconTexture . get_names ( ) [ 0 ] , DOMINANT_COLOR_ICON_SIZE , 0 ) ; if ( icon_info !== null ) return icon_info . load_icon ( ) ; else return null ; }
Try to get the pixel buffer for the current icon, if not fail gracefully
Try to get the pixel buffer for the current icon if not fail gracefully
// Make sure the correct theme is loaded // Unable to load the icon texture, use fallback // Unable to load the icon texture, use fallback // Use GdkPixBuf to load the pixel buffer from the provided file path // Get the pixel buffer from the icon theme