diff options
author | Carlos Garnacho <carlos@lanedo.com> | 2013-05-10 18:06:00 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2013-07-03 14:39:26 +0200 |
commit | 58adb70d43dfc6a10dde5847850c8a58e0c08137 (patch) | |
tree | f3b640ee0eb3cc4cadfd152409749a74964fab4c /gtk/gtkicontheme.h | |
parent | 07519abcde4e1b5fcb82c18c64716cca7b0920fb (diff) | |
download | gtk+-58adb70d43dfc6a10dde5847850c8a58e0c08137.tar.gz |
icontheme: Add support for high resolution icons
An optional OutputScale integer key has been added to index.theme
subdirs description, so icon themes may provide icons that are
more suitable to render at a (typically 2x) integer upscaled
resolution. This way it is possible to make eg. a 16x16@2x icon has a
real size of 32x32, but contains a similar level of detail to the
16x16 icon so things don't look any more cluttered on high-dpi
screens.
The pixbuf lookup has changed so it prefers a minimal scale change
that yields the minimal real size difference, so if looking up for
a 16x16 icon at 2x, it would first prefer 16x16@2x, then 32x32, and
then any other icon that's closest to match
There is now *_for_scale() variants for all GtkIconTheme ways
to directly or indirectly fetch a GdkPixbuf.
This is based on code by Carlos Garnacho with changes by Alexander
Larsson
Diffstat (limited to 'gtk/gtkicontheme.h')
-rw-r--r-- | gtk/gtkicontheme.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h index 443457dbf3..0902909459 100644 --- a/gtk/gtkicontheme.h +++ b/gtk/gtkicontheme.h @@ -179,23 +179,49 @@ GtkIconInfo * gtk_icon_theme_lookup_icon (GtkIconTheme const gchar *icon_name, gint size, GtkIconLookupFlags flags); +GDK_AVAILABLE_IN_3_10 +GtkIconInfo * gtk_icon_theme_lookup_icon_for_scale (GtkIconTheme *icon_theme, + const gchar *icon_name, + gint size, + gint scale, + GtkIconLookupFlags flags); + GDK_AVAILABLE_IN_ALL GtkIconInfo * gtk_icon_theme_choose_icon (GtkIconTheme *icon_theme, const gchar *icon_names[], gint size, GtkIconLookupFlags flags); +GDK_AVAILABLE_IN_3_10 +GtkIconInfo * gtk_icon_theme_choose_icon_for_scale (GtkIconTheme *icon_theme, + const gchar *icon_names[], + gint size, + gint scale, + GtkIconLookupFlags flags); GDK_AVAILABLE_IN_ALL GdkPixbuf * gtk_icon_theme_load_icon (GtkIconTheme *icon_theme, const gchar *icon_name, gint size, GtkIconLookupFlags flags, GError **error); +GDK_AVAILABLE_IN_3_10 +GdkPixbuf * gtk_icon_theme_load_icon_for_scale (GtkIconTheme *icon_theme, + const gchar *icon_name, + gint size, + gint scale, + GtkIconLookupFlags flags, + GError **error); GDK_AVAILABLE_IN_ALL GtkIconInfo * gtk_icon_theme_lookup_by_gicon (GtkIconTheme *icon_theme, GIcon *icon, gint size, GtkIconLookupFlags flags); +GtkIconInfo * gtk_icon_theme_lookup_by_gicon_for_scale (GtkIconTheme *icon_theme, + GIcon *icon, + gint size, + gint scale, + GtkIconLookupFlags flags); + GDK_AVAILABLE_IN_ALL GList * gtk_icon_theme_list_icons (GtkIconTheme *icon_theme, @@ -226,6 +252,8 @@ GtkIconInfo * gtk_icon_info_new_for_pixbuf (GtkIconTheme *icon_them GDK_AVAILABLE_IN_ALL gint gtk_icon_info_get_base_size (GtkIconInfo *icon_info); +GDK_AVAILABLE_IN_3_10 +gint gtk_icon_info_get_base_scale (GtkIconInfo *icon_info); GDK_AVAILABLE_IN_ALL const gchar * gtk_icon_info_get_filename (GtkIconInfo *icon_info); GDK_AVAILABLE_IN_ALL |