summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-autorun.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 /libcaja-private/caja-autorun.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 'libcaja-private/caja-autorun.c')
-rw-r--r--libcaja-private/caja-autorun.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libcaja-private/caja-autorun.c b/libcaja-private/caja-autorun.c
index 22ed18df..f0a36b4d 100644
--- a/libcaja-private/caja-autorun.c
+++ b/libcaja-private/caja-autorun.c
@@ -468,7 +468,7 @@ caja_autorun_prepare_combo_box (GtkWidget *combo_box,
GtkListStore *list_store;
GtkTreeIter iter;
GdkPixbuf *pixbuf;
- int icon_size;
+ int icon_size, icon_scale;
int set_active;
int n;
int num_apps;
@@ -484,6 +484,7 @@ caja_autorun_prepare_combo_box (GtkWidget *combo_box,
pref_ask = !pref_start_app && !pref_ignore && !pref_open_folder;
icon_size = caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
+ icon_scale = gtk_widget_get_scale_factor (combo_box);
set_active = -1;
data = NULL;
@@ -593,7 +594,7 @@ caja_autorun_prepare_combo_box (GtkWidget *combo_box,
*/
icon = g_app_info_get_icon (app_info);
- icon_info = caja_icon_info_lookup (icon, icon_size);
+ icon_info = caja_icon_info_lookup (icon, icon_size, icon_scale);
pixbuf = caja_icon_info_get_pixbuf_at_size (icon_info, icon_size);
g_object_unref (icon_info);
@@ -934,7 +935,7 @@ do_autorun_for_content_type (GMount *mount, const char *x_content_type, CajaAuto
GIcon *icon;
GdkPixbuf *pixbuf;
CajaIconInfo *icon_info;
- int icon_size;
+ int icon_size, icon_scale;
gboolean user_forced_dialog;
gboolean pref_ask;
gboolean pref_start_app;
@@ -998,7 +999,8 @@ show_dialog:
icon = g_mount_get_icon (mount);
icon_size = caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_DIALOG);
- icon_info = caja_icon_info_lookup (icon, icon_size);
+ icon_scale = gtk_widget_get_scale_factor (dialog);
+ icon_info = caja_icon_info_lookup (icon, icon_size, icon_scale);
pixbuf = caja_icon_info_get_pixbuf_at_size (icon_info, icon_size);
g_object_unref (icon_info);
g_object_unref (icon);