summaryrefslogtreecommitdiff
path: root/src/caja-emblem-sidebar.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-emblem-sidebar.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-emblem-sidebar.c')
-rw-r--r--src/caja-emblem-sidebar.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/caja-emblem-sidebar.c b/src/caja-emblem-sidebar.c
index 0c5b0056..a1c7f573 100644
--- a/src/caja-emblem-sidebar.c
+++ b/src/caja-emblem-sidebar.c
@@ -386,14 +386,15 @@ create_emblem_widget_with_pixbuf (CajaEmblemSidebar *emblem_sidebar,
{
GtkWidget *image, *event_box;
GdkPixbuf *prelight_pixbuf;
-
+ gint scale;
image = eel_labeled_image_new (display_name, pixbuf);
+ scale = gtk_widget_get_scale_factor (image);
eel_labeled_image_set_fixed_image_height (EEL_LABELED_IMAGE (image),
- STANDARD_EMBLEM_HEIGHT);
+ STANDARD_EMBLEM_HEIGHT * scale);
eel_labeled_image_set_spacing (EEL_LABELED_IMAGE (image),
- EMBLEM_LABEL_SPACING);
+ EMBLEM_LABEL_SPACING * scale);
event_box = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (event_box), image);
@@ -449,8 +450,10 @@ create_emblem_widget (CajaEmblemSidebar *emblem_sidebar,
char *keyword;
GdkPixbuf *pixbuf;
CajaIconInfo *info;
+ gint scale;
- info = caja_icon_info_lookup_from_name (name, CAJA_ICON_SIZE_STANDARD);
+ scale = gtk_widget_get_scale_factor (GTK_WIDGET (emblem_sidebar->details->emblems_table));
+ info = caja_icon_info_lookup_from_name (name, CAJA_ICON_SIZE_STANDARD, scale);
pixbuf = caja_icon_info_get_pixbuf_at_size (info, CAJA_ICON_SIZE_STANDARD);