summaryrefslogtreecommitdiff
path: root/src/caja-sidebar-title.c
diff options
context:
space:
mode:
authorCosimo Cecchi <[email protected]>2013-08-02 14:37:13 +0200
committerlukefromdc <[email protected]>2018-04-04 21:53:21 -0400
commitbc1405c9f54e19e74f973581130229ef1053ff9c (patch)
tree8ae544cad7a3b815ff6c48304ced204f37dd4947 /src/caja-sidebar-title.c
parent779e0af4042b6572d729190067cfee6a876d73e5 (diff)
downloadcaja-bc1405c9f54e19e74f973581130229ef1053ff9c.tar.bz2
caja-bc1405c9f54e19e74f973581130229ef1053ff9c.tar.xz
Support HiDpi icons
Port the rendering of icons to cairo surfaces, so that we can apply the GDK scale factor when rendering icons. origin commit: https://gitlab.gnome.org/GNOME/nautilus/commit/0d4555d7
Diffstat (limited to 'src/caja-sidebar-title.c')
-rw-r--r--src/caja-sidebar-title.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/caja-sidebar-title.c b/src/caja-sidebar-title.c
index 372e7ee1..3b257230 100644
--- a/src/caja-sidebar-title.c
+++ b/src/caja-sidebar-title.c
@@ -356,16 +356,18 @@ update_icon (CajaSidebarTitle *sidebar_title)
CajaIconInfo *info;
char *icon_name;
gboolean leave_pixbuf_unchanged;
+ gint icon_scale;
leave_pixbuf_unchanged = FALSE;
/* see if the current content view is specifying an icon */
icon_name = get_property_from_component (sidebar_title, "icon_name");
+ icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (sidebar_title));
pixbuf = NULL;
if (icon_name != NULL && icon_name[0] != '\0')
{
- info = caja_icon_info_lookup_from_name (icon_name, CAJA_ICON_SIZE_LARGE);
+ info = caja_icon_info_lookup_from_name (icon_name, CAJA_ICON_SIZE_LARGE, icon_scale);
pixbuf = caja_icon_info_get_pixbuf_at_size (info, CAJA_ICON_SIZE_LARGE);
g_object_unref (info);
}
@@ -376,6 +378,7 @@ update_icon (CajaSidebarTitle *sidebar_title)
pixbuf = caja_file_get_icon_pixbuf (sidebar_title->details->file,
sidebar_title->details->best_icon_size,
TRUE,
+ icon_scale,
CAJA_FILE_ICON_FLAGS_USE_THUMBNAILS |
CAJA_FILE_ICON_FLAGS_USE_MOUNT_ICON_AS_EMBLEM);
}