summaryrefslogtreecommitdiff
path: root/src/caja-spatial-window.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/caja-spatial-window.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/caja-spatial-window.c')
-rw-r--r--src/caja-spatial-window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/caja-spatial-window.c b/src/caja-spatial-window.c
index 6d3d0112..22a0dd74 100644
--- a/src/caja-spatial-window.c
+++ b/src/caja-spatial-window.c
@@ -356,7 +356,8 @@ static CajaIconInfo *
real_get_icon (CajaWindow *window,
CajaWindowSlot *slot)
{
- return caja_file_get_icon (slot->viewed_file, 48,
+ return caja_file_get_icon (slot->viewed_file,
+ 48, gtk_widget_get_scale_factor (GTK_WIDGET (window)),
CAJA_FILE_ICON_FLAGS_IGNORE_VISITING |
CAJA_FILE_ICON_FLAGS_USE_MOUNT_ICON);
}
@@ -581,6 +582,7 @@ got_file_info_for_location_menu_callback (CajaFile *file,
pixbuf = caja_file_get_icon_pixbuf (file,
caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU),
TRUE,
+ gtk_widget_get_scale_factor (GTK_WIDGET (menu_item)),
CAJA_FILE_ICON_FLAGS_IGNORE_VISITING);
if (pixbuf != NULL)
@@ -785,6 +787,7 @@ location_button_drag_begin_callback (GtkWidget *widget,
pixbuf = caja_file_get_icon_pixbuf (slot->viewed_file,
get_dnd_icon_size (window),
FALSE,
+ gtk_widget_get_scale_factor (widget),
CAJA_FILE_ICON_FLAGS_IGNORE_VISITING | CAJA_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT);
gtk_drag_set_icon_pixbuf (context, pixbuf, 0, 0);
@@ -862,6 +865,7 @@ caja_spatial_window_set_location_button (CajaSpatialWindow *window,
pixbuf = caja_file_get_icon_pixbuf (file,
caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU),
TRUE,
+ gtk_widget_get_scale_factor (window->details->location_button),
CAJA_FILE_ICON_FLAGS_IGNORE_VISITING);
if (pixbuf != NULL)