diff options
author | Cosimo Cecchi <[email protected]> | 2013-08-02 14:37:13 +0200 |
---|---|---|
committer | lukefromdc <[email protected]> | 2018-04-04 21:53:21 -0400 |
commit | bc1405c9f54e19e74f973581130229ef1053ff9c (patch) | |
tree | 8ae544cad7a3b815ff6c48304ced204f37dd4947 /src/caja-places-sidebar.c | |
parent | 779e0af4042b6572d729190067cfee6a876d73e5 (diff) | |
download | caja-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-places-sidebar.c')
-rw-r--r-- | src/caja-places-sidebar.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c index c5566c15..1a475b17 100644 --- a/src/caja-places-sidebar.c +++ b/src/caja-places-sidebar.c @@ -233,11 +233,12 @@ get_eject_icon (gboolean highlighted) { GdkPixbuf *eject; CajaIconInfo *eject_icon_info; - int icon_size; + int icon_size, icon_scale; icon_size = caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU); + icon_scale = gdk_window_get_scale_factor (gdk_get_default_root_window ()); - eject_icon_info = caja_icon_info_lookup_from_name ("media-eject", icon_size); + eject_icon_info = caja_icon_info_lookup_from_name ("media-eject", icon_size, icon_scale); eject = caja_icon_info_get_pixbuf_at_size (eject_icon_info, icon_size); if (highlighted) { @@ -342,6 +343,7 @@ add_place (CajaPlacesSidebar *sidebar, GdkPixbuf *eject; CajaIconInfo *icon_info; int icon_size; + int icon_scale; gboolean show_eject; gboolean show_unmount; gboolean show_eject_button; @@ -349,7 +351,8 @@ add_place (CajaPlacesSidebar *sidebar, check_heading_for_section (sidebar, section_type); icon_size = caja_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU); - icon_info = caja_icon_info_lookup (icon, icon_size); + icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (sidebar)); + 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); |