Drop gtk_icon_info_new_for_pixbuf

It is better to keep icon infos as something you
only get from the icon theme.
This commit is contained in:
Matthias Clasen 2019-10-18 08:47:07 -05:00
parent 416b2cd18d
commit 1dd55ed600
3 changed files with 13 additions and 30 deletions

View File

@ -5311,7 +5311,6 @@ gtk_icon_theme_load_icon_for_scale
gtk_icon_theme_list_icons
gtk_icon_theme_get_icon_sizes
gtk_icon_theme_rescan_if_needed
gtk_icon_info_new_for_pixbuf
gtk_icon_info_get_base_size
gtk_icon_info_get_base_scale
gtk_icon_info_get_filename

View File

@ -4280,6 +4280,19 @@ gtk_icon_info_new_for_file (GFile *file,
return info;
}
static GtkIconInfo *
gtk_icon_info_new_for_pixbuf (GtkIconTheme *icon_theme,
GdkPixbuf *pixbuf)
{
GtkIconInfo *info;
info = icon_info_new (ICON_THEME_DIR_UNTHEMED, 0, 1);
info->texture = gdk_texture_new_for_pixbuf (pixbuf);
info->scale = 1.0;
return info;
}
/**
* gtk_icon_theme_lookup_by_gicon_for_scale:
* @self: a #GtkIconTheme
@ -4380,28 +4393,3 @@ gtk_icon_theme_lookup_by_gicon_for_scale (GtkIconTheme *self,
return NULL;
}
/**
* gtk_icon_info_new_for_pixbuf:
* @icon_theme: a #GtkIconTheme
* @pixbuf: the pixbuf to wrap in a #GtkIconInfo
*
* Creates a #GtkIconInfo for a #GdkPixbuf.
*
* Returns: (transfer full): a #GtkIconInfo
*/
GtkIconInfo *
gtk_icon_info_new_for_pixbuf (GtkIconTheme *icon_theme,
GdkPixbuf *pixbuf)
{
GtkIconInfo *info;
g_return_val_if_fail (GTK_IS_ICON_THEME (icon_theme), NULL);
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
info = icon_info_new (ICON_THEME_DIR_UNTHEMED, 0, 1);
info->texture = gdk_texture_new_for_pixbuf (pixbuf);
info->scale = 1.0;
return info;
}

View File

@ -205,10 +205,6 @@ gboolean gtk_icon_theme_rescan_if_needed (GtkIconTheme
GDK_AVAILABLE_IN_ALL
GType gtk_icon_info_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkIconInfo * gtk_icon_info_new_for_pixbuf (GtkIconTheme *icon_theme,
GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_ALL
gint gtk_icon_info_get_base_size (GtkIconInfo *self);
GDK_AVAILABLE_IN_ALL