summaryrefslogtreecommitdiff
path: root/src/file-manager/fm-tree-model.c
diff options
context:
space:
mode:
authorCosimo Cecchi <[email protected]>2013-08-02 14:37:13 +0200
committerraveit65 <[email protected]>2018-04-05 09:07:22 +0200
commit4bf67ac8fff8555bf784d8cd7e1611829a9fca44 (patch)
tree343275a74d64866035b0850d5583c83eb20fe486 /src/file-manager/fm-tree-model.c
parent35c4dc6021f36a5fc7df94b0332c7e5d6fa00d0a (diff)
downloadcaja-4bf67ac8fff8555bf784d8cd7e1611829a9fca44.tar.bz2
caja-4bf67ac8fff8555bf784d8cd7e1611829a9fca44.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/file-manager/fm-tree-model.c')
-rw-r--r--src/file-manager/fm-tree-model.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/file-manager/fm-tree-model.c b/src/file-manager/fm-tree-model.c
index cf400375..e3bcfd3c 100644
--- a/src/file-manager/fm-tree-model.c
+++ b/src/file-manager/fm-tree-model.c
@@ -258,11 +258,12 @@ get_menu_icon (GIcon *icon)
{
CajaIconInfo *info;
GdkPixbuf *pixbuf;
- int size;
+ int size, scale;
size = caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
+ scale = gdk_window_get_scale_factor (gdk_get_default_root_window ());
- info = caja_icon_info_lookup (icon, size);
+ info = caja_icon_info_lookup (icon, size, scale);
pixbuf = caja_icon_info_get_pixbuf_nodefault_at_size (info, size);
g_object_unref (info);
@@ -279,13 +280,14 @@ get_menu_icon_for_file (TreeNode *node,
GEmblem *emblem;
GdkPixbuf *pixbuf, *retval;
gboolean highlight;
- int size;
+ int size, scale;
FMTreeModel *model;
GList *emblem_icons, *l;
char *emblems_to_ignore[3];
int i;
size = caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
+ scale = gdk_window_get_scale_factor (gdk_get_default_root_window ());
gicon = caja_file_get_gicon (file, flags);
@@ -321,7 +323,7 @@ get_menu_icon_for_file (TreeNode *node,
g_list_free_full (emblem_icons, g_object_unref);
- info = caja_icon_info_lookup (gicon, size);
+ info = caja_icon_info_lookup (gicon, size, scale);
retval = caja_icon_info_get_pixbuf_nodefault_at_size (info, size);
model = node->root->model;