summaryrefslogtreecommitdiff
path: root/src/caja-property-browser.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-property-browser.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-property-browser.c')
-rw-r--r--src/caja-property-browser.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/caja-property-browser.c b/src/caja-property-browser.c
index ca161803..aee03041 100644
--- a/src/caja-property-browser.c
+++ b/src/caja-property-browser.c
@@ -725,6 +725,7 @@ make_drag_image (CajaPropertyBrowser *property_browser, const char* file_name)
char *icon_name;
gboolean is_reset;
CajaIconInfo *info;
+ gint icon_scale;
if (property_browser->details->category_type == CAJA_PROPERTY_EMBLEM)
{
@@ -742,7 +743,8 @@ make_drag_image (CajaPropertyBrowser *property_browser, const char* file_name)
else
{
icon_name = caja_emblem_get_icon_name_from_keyword (file_name);
- info = caja_icon_info_lookup_from_name (icon_name, CAJA_ICON_SIZE_STANDARD);
+ icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (property_browser->details->content_table));
+ info = caja_icon_info_lookup_from_name (icon_name, CAJA_ICON_SIZE_STANDARD, icon_scale);
pixbuf = caja_icon_info_get_pixbuf_at_size (info, CAJA_ICON_SIZE_STANDARD);
g_object_unref (info);
g_free (icon_name);
@@ -1814,6 +1816,7 @@ make_properties_from_directories (CajaPropertyBrowser *property_browser)
guint num_images;
char *path;
CajaIconInfo *info;
+ gint icon_scale;
g_return_if_fail (CAJA_IS_PROPERTY_BROWSER (property_browser));
g_return_if_fail (EEL_IS_IMAGE_TABLE (property_browser->details->content_table));
@@ -1826,6 +1829,7 @@ make_properties_from_directories (CajaPropertyBrowser *property_browser)
property_browser->details->keywords = NULL;
icons = caja_emblem_list_available ();
+ icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (property_browser->details->content_table));
property_browser->details->has_local = FALSE;
l = icons;
@@ -1849,7 +1853,7 @@ make_properties_from_directories (CajaPropertyBrowser *property_browser)
g_free (object_name);
continue;
}
- info = caja_icon_info_lookup_from_name (icon_name, CAJA_ICON_SIZE_STANDARD);
+ info = caja_icon_info_lookup_from_name (icon_name, CAJA_ICON_SIZE_STANDARD, icon_scale);
object_pixbuf = caja_icon_info_get_pixbuf_at_size (info, CAJA_ICON_SIZE_STANDARD);
object_label = g_strdup (caja_icon_info_get_display_name (info));
g_object_unref (info);